diff --git a/hapi-deployable-pom/pom.xml b/hapi-deployable-pom/pom.xml new file mode 100644 index 00000000000..784685bbc06 --- /dev/null +++ b/hapi-deployable-pom/pom.xml @@ -0,0 +1,81 @@ + + 4.0.0 + + + ca.uhn.hapi.fhir + hapi-fhir + 0.8-SNAPSHOT + ../pom.xml + + + hapi-deployable-pom + pom + + HAPI FHIR - Deployable Artifact Parent POM + + + + DIST + + + + org.apache.maven.plugins + maven-javadoc-plugin + true + + 128m + 1g + true + false + false + + + + package + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + ${maven_source_plugin_version} + + + package + + jar-no-fork + + + + + + org.codehaus.mojo + license-maven-plugin + ${maven_license_plugin_version} + + + first + + update-file-header + + process-sources + + apache_v2 + true + true + + src/main/java + + + + + + + + + + + diff --git a/hapi-fhir-base/.gitignore b/hapi-fhir-base/.gitignore index 4dc009173e3..f7e179f26d2 100644 --- a/hapi-fhir-base/.gitignore +++ b/hapi-fhir-base/.gitignore @@ -1,2 +1,3 @@ /target /bin +/target/ diff --git a/hapi-fhir-base/.settings/org.eclipse.core.resources.prefs b/hapi-fhir-base/.settings/org.eclipse.core.resources.prefs index 29abf999564..989609020a0 100644 --- a/hapi-fhir-base/.settings/org.eclipse.core.resources.prefs +++ b/hapi-fhir-base/.settings/org.eclipse.core.resources.prefs @@ -1,6 +1,5 @@ eclipse.preferences.version=1 encoding//src/main/java=UTF-8 encoding//src/main/resources=UTF-8 -encoding//src/test/java=UTF-8 encoding//src/test/resources=UTF-8 encoding/=UTF-8 diff --git a/hapi-fhir-base/examples/pom.xml b/hapi-fhir-base/examples/pom.xml index 7e49bbaaa83..d20bcfb8574 100644 --- a/hapi-fhir-base/examples/pom.xml +++ b/hapi-fhir-base/examples/pom.xml @@ -19,6 +19,11 @@ hapi-fhir-base 0.8-SNAPSHOT + + ca.uhn.hapi.fhir + hapi-fhir-structures-dstu + 0.8-SNAPSHOT + javax.servlet javax.servlet-api diff --git a/hapi-fhir-base/examples/pom.xml.orig b/hapi-fhir-base/examples/pom.xml.orig new file mode 100644 index 00000000000..09ea3151fb1 --- /dev/null +++ b/hapi-fhir-base/examples/pom.xml.orig @@ -0,0 +1,55 @@ + + 4.0.0 + + + ca.uhn.hapi.fhir + hapi-fhir + 0.8-SNAPSHOT + ../../pom.xml + + + hapi-fhir-base-examples + jar + + HAPI FHIR - Examples (for site) + + + + ca.uhn.hapi.fhir + hapi-fhir-base + 0.8-SNAPSHOT +<<<<<<< HEAD +======= + + + ca.uhn.hapi.fhir + hapi-fhir-structures-dstu + 0.8-SNAPSHOT +>>>>>>> versions + + + javax.servlet + javax.servlet-api + 3.1.0 + provided + + + junit + junit + ${junit_version} + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + true + + + + + + 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 08d82b1a6bd..6d6df92d50b 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; @@ -82,19 +84,19 @@ public class GenericClientExample { // START SNIPPET: conformance // Retrieve the server's conformance statement and print its // description - Conformance conf = client.conformance(); - System.out.println(conf.getDescription().getValue()); + BaseConformance conf = client.conformance(); + System.out.println(conf.getDescriptionElement().getValue()); // END SNIPPET: conformance } { // 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) { - System.out.println(outcome.getIssueFirstRep().getDetails().getValue()); + System.out.println(outcome.getIssueFirstRep().getDetailsElement().getValue()); } // END SNIPPET: delete } 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 d1aefe3ae3e..98a68b1a870 100644 --- a/hapi-fhir-base/pom.xml +++ b/hapi-fhir-base/pom.xml @@ -3,9 +3,9 @@ ca.uhn.hapi.fhir - hapi-fhir + hapi-deployable-pom 0.8-SNAPSHOT - ../pom.xml + ../hapi-deployable-pom/pom.xml hapi-fhir-base @@ -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 - - @@ -666,39 +538,6 @@ DIST - - org.apache.maven.plugins - maven-javadoc-plugin - true - - 128m - 1g - true - false - false - - - - package - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - ${maven_source_plugin_version} - - - package - - jar-no-fork - - - - maven-assembly-plugin ${maven_assembly_plugin_version} @@ -718,28 +557,6 @@ - - org.codehaus.mojo - license-maven-plugin - ${maven_license_plugin_version} - - - first - - update-file-header - - process-sources - - apache_v2 - true - true - - src/main/java - - - - - diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/BaseRuntimeDeclaredChildDefinition.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/BaseRuntimeDeclaredChildDefinition.java index 4de627af2c0..649e2408c15 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/BaseRuntimeDeclaredChildDefinition.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/BaseRuntimeDeclaredChildDefinition.java @@ -81,10 +81,10 @@ public abstract class BaseRuntimeDeclaredChildDefinition extends BaseRuntimeChil if (ourUseMethodAccessors == null) { try { myField.setAccessible(true); - ourUseMethodAccessors = true; + ourUseMethodAccessors = false; } catch (SecurityException e) { ourLog.info("Can not use field accessors/mutators, going to use methods instead"); - ourUseMethodAccessors = false; + ourUseMethodAccessors = true; } } 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 ac1627e76d6..615fe7b63ad 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 @@ -32,6 +32,7 @@ import org.apache.commons.lang3.text.WordUtils; 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.view.ViewGenerator; import ca.uhn.fhir.narrative.INarrativeGenerator; @@ -72,6 +73,7 @@ public class FhirContext { private volatile INarrativeGenerator myNarrativeGenerator; private volatile IRestfulClientFactory myRestfulClientFactory; private volatile RuntimeChildUndeclaredExtensionDefinition myRuntimeChildUndeclaredExtensionDefinition; + private IFhirVersion myVersion; /** * Default constructor. In most cases this is the right constructor to use. @@ -90,6 +92,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-FHIR v0.8, a separate FHIR strcture JAR must be added to your classpath or project pom.xml"); + } + } /** @@ -197,6 +206,10 @@ public class FhirContext { return myRuntimeChildUndeclaredExtensionDefinition; } + public IFhirVersion getVersion() { + return myVersion; + } + /** * Create and return a new JSON parser. * @@ -282,7 +295,7 @@ public class FhirContext { } private Map, BaseRuntimeElementDefinition> scanResourceTypes(Collection> theResourceTypes) { - ModelScanner scanner = new ModelScanner(myClassToElementDefinition, theResourceTypes); + ModelScanner scanner = new ModelScanner(this, myClassToElementDefinition, theResourceTypes); if (myRuntimeChildUndeclaredExtensionDefinition == null) { myRuntimeChildUndeclaredExtensionDefinition = scanner.getRuntimeChildUndeclaredExtensionDefinition(); } 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..a34d7e71c53 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirVersionEnum.java @@ -0,0 +1,69 @@ +package ca.uhn.fhir.context; + +/* + * #%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.IFhirVersion; +import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; + +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/context/ModelScanner.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/ModelScanner.java index edb89246630..8a0f0ba3ced 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/ModelScanner.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/ModelScanner.java @@ -20,7 +20,7 @@ package ca.uhn.fhir.context; * #L% */ -import static org.apache.commons.lang3.StringUtils.*; +import static org.apache.commons.lang3.StringUtils.isBlank; import java.io.IOException; import java.io.InputStream; @@ -45,6 +45,7 @@ import java.util.TreeSet; import ca.uhn.fhir.model.api.CodeableConceptElement; import ca.uhn.fhir.model.api.ExtensionDt; +import ca.uhn.fhir.model.api.IBoundCodeableConcept; import ca.uhn.fhir.model.api.ICodeEnum; import ca.uhn.fhir.model.api.ICompositeDatatype; import ca.uhn.fhir.model.api.ICompositeElement; @@ -64,10 +65,8 @@ import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; import ca.uhn.fhir.model.base.composite.BaseResourceReferenceDt; import ca.uhn.fhir.model.dstu.composite.ContainedDt; import ca.uhn.fhir.model.dstu.composite.NarrativeDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.SearchParamTypeEnum; import ca.uhn.fhir.model.primitive.BoundCodeDt; -import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; import ca.uhn.fhir.model.primitive.ICodedDatatype; import ca.uhn.fhir.model.primitive.XhtmlDt; import ca.uhn.fhir.util.ReflectionUtil; @@ -91,17 +90,22 @@ class ModelScanner { private Set> myScanAlsoCodeTable = new HashSet>(); - ModelScanner(Class theResourceTypes) throws ConfigurationException { + private FhirContext myContext; + + ModelScanner(FhirContext theContext, Class theResourceTypes) throws ConfigurationException { + myContext=theContext; Set> singleton = new HashSet>(); singleton.add(theResourceTypes); init(null, singleton); } - ModelScanner(Collection> theResourceTypes) throws ConfigurationException { + ModelScanner(FhirContext theContext, Collection> theResourceTypes) throws ConfigurationException { + myContext=theContext; init(null, new HashSet>(theResourceTypes)); } - ModelScanner(Map, BaseRuntimeElementDefinition> theExistingDefinitions, Collection> theResourceTypes) throws ConfigurationException { + ModelScanner(FhirContext theContext, Map, BaseRuntimeElementDefinition> theExistingDefinitions, Collection> theResourceTypes) throws ConfigurationException { + myContext=theContext; init(theExistingDefinitions, new HashSet>(theResourceTypes)); } @@ -479,7 +483,7 @@ class ModelScanner { RuntimeChildContainedResources def = new RuntimeChildContainedResources(next, childAnnotation, descriptionAnnotation, elementName); orderMap.put(order, def); - } else if (choiceTypes.size() > 1 && !ResourceReferenceDt.class.isAssignableFrom(nextElementType)) { + } else if (choiceTypes.size() > 1 && !BaseResourceReferenceDt.class.isAssignableFrom(nextElementType)) { /* * Child is a choice element */ @@ -514,7 +518,7 @@ class ModelScanner { List> refTypesList = new ArrayList>(); for (Class nextType : childAnnotation.type()) { if (IResource.class.isAssignableFrom(nextType) == false) { - throw new ConfigurationException("Field '" + next.getName() + "' in class '" + next.getDeclaringClass().getCanonicalName() + "' is of type " + ResourceReferenceDt.class + " but contains a non-resource type: " + nextType.getCanonicalName()); + throw new ConfigurationException("Field '" + next.getName() + "' in class '" + next.getDeclaringClass().getCanonicalName() + "' is of type " + BaseResourceReferenceDt.class + " but contains a non-resource type: " + nextType.getCanonicalName()); } refTypesList.add((Class) nextType); addScanAlso(nextType); @@ -551,7 +555,7 @@ class ModelScanner { def = new RuntimeChildPrimitiveDatatypeDefinition(next, elementName, descriptionAnnotation, childAnnotation, nextDatatype); } } else { - if (nextElementType.equals(BoundCodeableConceptDt.class)) { + if (IBoundCodeableConcept.class.isAssignableFrom(nextElementType)) { IValueSetEnumBinder> binder = getBoundCodeBinder(next); def = new RuntimeChildCompositeBoundDatatypeDefinition(next, elementName, childAnnotation, descriptionAnnotation, nextDatatype, binder); } else if (NarrativeDt.class.getSimpleName().equals(nextElementType.getSimpleName())) { @@ -649,7 +653,7 @@ class ModelScanner { } } - RuntimeResourceDefinition resourceDef = new RuntimeResourceDefinition(resourceName, theClass, resourceDefinition); + RuntimeResourceDefinition resourceDef = new RuntimeResourceDefinition(myContext, resourceName, theClass, resourceDefinition); myClassToElementDefinitions.put(theClass, resourceDef); if (primaryNameProvider) { myNameToResourceDefinitions.put(resourceName, resourceDef); diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeResourceDefinition.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeResourceDefinition.java index 557feae8a52..a3e08640339 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeResourceDefinition.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeResourceDefinition.java @@ -20,52 +20,40 @@ package ca.uhn.fhir.context; * #L% */ -import static org.apache.commons.lang3.StringUtils.*; - import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; -import java.util.Iterator; import java.util.LinkedHashMap; -import java.util.LinkedList; import java.util.List; import java.util.Map; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.text.WordUtils; - import ca.uhn.fhir.model.api.IElement; -import ca.uhn.fhir.model.api.IPrimitiveDatatype; import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.api.annotation.Child; import ca.uhn.fhir.model.api.annotation.ResourceDef; -import ca.uhn.fhir.model.dstu.resource.Profile; -import ca.uhn.fhir.model.dstu.resource.Profile.ExtensionDefn; -import ca.uhn.fhir.model.dstu.resource.Profile.Structure; -import ca.uhn.fhir.model.dstu.resource.Profile.StructureElement; -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; public class RuntimeResourceDefinition extends BaseRuntimeElementCompositeDefinition { private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(RuntimeResourceDefinition.class); private RuntimeResourceDefinition myBaseDefinition; - private Map myExtensionDefToCode = new HashMap(); - private String myId; private Map myNameToSearchParam = new LinkedHashMap(); - private Profile myProfileDef; + private IResource myProfileDef; private String myResourceProfile; private List mySearchParams; + private FhirContext myContext; + private String myId; - public RuntimeResourceDefinition(String theResourceName, Class theClass, ResourceDef theResourceAnnotation) { + public RuntimeResourceDefinition(FhirContext theContext, String theResourceName, Class theClass, ResourceDef theResourceAnnotation) { super(theResourceName, theClass); + myContext= theContext; myResourceProfile = theResourceAnnotation.profile(); myId = theResourceAnnotation.id(); } + public String getId() { + return myId; + } + public void addSearchParam(RuntimeSearchParam theParam) { myNameToSearchParam.put(theParam.getName(), theParam); } @@ -129,253 +117,17 @@ public class RuntimeResourceDefinition extends BaseRuntimeElementCompositeDefini } while (target.equals(Object.class)==false); } - public synchronized Profile toProfile() { + public synchronized IResource toProfile() { if (myProfileDef != null) { return myProfileDef; } - Profile retVal = new Profile(); - - RuntimeResourceDefinition def = this; - - if (StringUtils.isBlank(myId)) { - myId = getName().toLowerCase(); - } - - retVal.setId(new IdDt(myId)); - - // Scan for extensions - scanForExtensions(retVal, def); - Collections.sort(retVal.getExtensionDefn(), new Comparator() { - @Override - public int compare(ExtensionDefn theO1, ExtensionDefn theO2) { - return theO1.getCode().compareTo(theO2.getCode()); - } - }); - - // Scan for children - retVal.setName(getName()); - Structure struct = retVal.addStructure(); - LinkedList path = new LinkedList(); - - StructureElement element = struct.addElement(); - element.getDefinition().setMin(1); - element.getDefinition().setMax("1"); - - fillProfile(struct, element, def, path, null); - - retVal.getStructure().get(0).getElement().get(0).getDefinition().addType().getCode().setValue("Resource"); - + IResource retVal = myContext.getVersion().generateProfile(this); myProfileDef = retVal; return retVal; } - private void fillBasics(StructureElement theElement, BaseRuntimeElementDefinition def, LinkedList path, BaseRuntimeDeclaredChildDefinition theChild) { - if (path.isEmpty()) { - path.add(def.getName()); - theElement.setName(def.getName()); - } else { - path.add(WordUtils.uncapitalize(theChild.getElementName())); - theElement.setName(theChild.getElementName()); - } - theElement.setPath(StringUtils.join(path, '.')); - } - private void fillExtensions(Structure theStruct, LinkedList path, List extList, String elementName, boolean theIsModifier) { - if (extList.size() > 0) { - StructureElement extSlice = theStruct.addElement(); - extSlice.setName(elementName); - extSlice.setPath(join(path, '.') + '.' + elementName); - extSlice.getSlicing().getDiscriminator().setValue("url"); - extSlice.getSlicing().setOrdered(false); - extSlice.getSlicing().setRules(SlicingRulesEnum.OPEN); - extSlice.getDefinition().addType().setCode(DataTypeEnum.EXTENSION); - - for (RuntimeChildDeclaredExtensionDefinition nextExt : extList) { - StructureElement nextProfileExt = theStruct.addElement(); - nextProfileExt.getDefinition().setIsModifier(theIsModifier); - nextProfileExt.setName(extSlice.getName()); - nextProfileExt.setPath(extSlice.getPath()); - fillMinAndMaxAndDefinitions(nextExt, nextProfileExt); - StructureElementDefinitionType type = nextProfileExt.getDefinition().addType(); - type.setCode(DataTypeEnum.EXTENSION); - if (nextExt.isDefinedLocally()) { - type.setProfile(nextExt.getExtensionUrl().substring(nextExt.getExtensionUrl().indexOf('#'))); - } else { - type.setProfile(nextExt.getExtensionUrl()); - } - } - } else { - StructureElement extSlice = theStruct.addElement(); - extSlice.setName(elementName); - extSlice.setPath(join(path, '.') + '.' + elementName); - extSlice.getDefinition().setIsModifier(theIsModifier); - extSlice.getDefinition().addType().setCode(DataTypeEnum.EXTENSION); - extSlice.getDefinition().setMin(0); - extSlice.getDefinition().setMax("*"); - } - } - - private void fillMinAndMaxAndDefinitions(BaseRuntimeDeclaredChildDefinition child, StructureElement elem) { - elem.getDefinition().setMin(child.getMin()); - if (child.getMax() == Child.MAX_UNLIMITED) { - elem.getDefinition().setMax("*"); - } else { - elem.getDefinition().setMax(Integer.toString(child.getMax())); - } - - if (isNotBlank(child.getShortDefinition())) { - elem.getDefinition().getShort().setValue(child.getShortDefinition()); - } - if (isNotBlank(child.getFormalDefinition())) { - elem.getDefinition().getFormal().setValue(child.getFormalDefinition()); - } - } - - private void fillName(StructureElement elem, BaseRuntimeElementDefinition nextDef) { - if (nextDef instanceof RuntimeResourceReferenceDefinition) { - RuntimeResourceReferenceDefinition rr = (RuntimeResourceReferenceDefinition) nextDef; - for (Class next : rr.getResourceTypes()) { - StructureElementDefinitionType type = elem.getDefinition().addType(); - type.getCode().setValue("ResourceReference"); - - if (next != IResource.class) { - RuntimeResourceDefinition resDef = rr.getDefinitionForResourceType(next); - type.getProfile().setValueAsString(resDef.getResourceProfile()); - } - } - - return; - } - - StructureElementDefinitionType type = elem.getDefinition().addType(); - String name = nextDef.getName(); - DataTypeEnum fromCodeString = DataTypeEnum.VALUESET_BINDER.fromCodeString(name); - if (fromCodeString == null) { - throw new ConfigurationException("Unknown type: " + name); - } - type.setCode(fromCodeString); - } - - private void fillProfile(Structure theStruct, StructureElement theElement, BaseRuntimeElementDefinition def, LinkedList path, BaseRuntimeDeclaredChildDefinition theChild) { - - fillBasics(theElement, def, path, theChild); - - String expectedPath = StringUtils.join(path, '.'); - - ourLog.info("Filling profile for: {} - Path: {}", expectedPath); - String name = def.getName(); - if (!expectedPath.equals(name)) { - path.pollLast(); - theElement.getDefinition().getNameReference().setValue(def.getName()); - return; - } - - fillExtensions(theStruct, path, def.getExtensionsNonModifier(), "extension", false); - fillExtensions(theStruct, path, def.getExtensionsModifier(), "modifierExtension", true); - - if (def.getChildType() == ChildTypeEnum.RESOURCE) { - StructureElement narrative = theStruct.addElement(); - narrative.setName("text"); - narrative.setPath(join(path, '.') + ".text"); - narrative.getDefinition().addType().setCode(DataTypeEnum.NARRATIVE); - narrative.getDefinition().setIsModifier(false); - narrative.getDefinition().setMin(0); - narrative.getDefinition().setMax("1"); - - StructureElement contained = theStruct.addElement(); - contained.setName("contained"); - contained.setPath(join(path, '.') + ".contained"); - contained.getDefinition().addType().getCode().setValue("Resource"); - contained.getDefinition().setIsModifier(false); - contained.getDefinition().setMin(0); - contained.getDefinition().setMax("1"); - } - - if (def instanceof BaseRuntimeElementCompositeDefinition) { - BaseRuntimeElementCompositeDefinition cdef = ((BaseRuntimeElementCompositeDefinition) def); - for (BaseRuntimeChildDefinition nextChild : cdef.getChildren()) { - if (nextChild instanceof RuntimeChildUndeclaredExtensionDefinition) { - continue; - } - - BaseRuntimeDeclaredChildDefinition child = (BaseRuntimeDeclaredChildDefinition) nextChild; - StructureElement elem = theStruct.addElement(); - fillMinAndMaxAndDefinitions(child, elem); - - if (child instanceof RuntimeChildResourceBlockDefinition) { - RuntimeResourceBlockDefinition nextDef = (RuntimeResourceBlockDefinition) child.getSingleChildOrThrow(); - fillProfile(theStruct, elem, nextDef, path, child); - } else if (child instanceof RuntimeChildContainedResources) { - // ignore - } else if (child instanceof RuntimeChildDeclaredExtensionDefinition) { - throw new IllegalStateException("Unexpected child type: " + child.getClass().getCanonicalName()); - } else if (child instanceof RuntimeChildCompositeDatatypeDefinition || child instanceof RuntimeChildPrimitiveDatatypeDefinition || child instanceof RuntimeChildChoiceDefinition - || child instanceof RuntimeChildResourceDefinition) { - Iterator childNamesIter = child.getValidChildNames().iterator(); - String nextName = childNamesIter.next(); - BaseRuntimeElementDefinition nextDef = child.getChildByName(nextName); - fillBasics(elem, nextDef, path, child); - fillName(elem, nextDef); - while (childNamesIter.hasNext()) { - nextDef = child.getChildByName(childNamesIter.next()); - fillName(elem, nextDef); - } - path.pollLast(); - } else { - throw new IllegalStateException("Unexpected child type: " + child.getClass().getCanonicalName()); - } - - } - } else { - throw new IllegalStateException("Unexpected child type: " + def.getClass().getCanonicalName()); - } - - path.pollLast(); - } - - private void scanForExtensions(Profile theProfile, BaseRuntimeElementDefinition def) { - BaseRuntimeElementCompositeDefinition cdef = ((BaseRuntimeElementCompositeDefinition) def); - - for (RuntimeChildDeclaredExtensionDefinition nextChild : cdef.getExtensions()) { - if (myExtensionDefToCode.containsKey(nextChild)) { - continue; - } - - if (nextChild.isDefinedLocally() == false) { - continue; - } - - ExtensionDefn defn = theProfile.addExtensionDefn(); - String code = null; - if (nextChild.getExtensionUrl().contains("#") && !nextChild.getExtensionUrl().endsWith("#")) { - code = nextChild.getExtensionUrl().substring(nextChild.getExtensionUrl().indexOf('#') + 1); - } else { - throw new ConfigurationException("Locally defined extension has no '#[code]' part in extension URL: " + nextChild.getExtensionUrl()); - } - - defn.setCode(code); - if (myExtensionDefToCode.values().contains(code)) { - throw new IllegalStateException("Duplicate extension code: " + code); - } - myExtensionDefToCode.put(nextChild, code); - - if (nextChild.getChildType() != null && IPrimitiveDatatype.class.isAssignableFrom(nextChild.getChildType())) { - RuntimePrimitiveDatatypeDefinition pdef = (RuntimePrimitiveDatatypeDefinition) nextChild.getSingleChildOrThrow(); - defn.getDefinition().addType().setCode(DataTypeEnum.VALUESET_BINDER.fromCodeString(pdef.getName())); - } else { - RuntimeResourceBlockDefinition pdef = (RuntimeResourceBlockDefinition) nextChild.getSingleChildOrThrow(); - scanForExtensions(theProfile, pdef); - - for (RuntimeChildDeclaredExtensionDefinition nextChildExt : pdef.getExtensions()) { - StructureElementDefinitionType type = defn.getDefinition().addType(); - type.setCode(DataTypeEnum.EXTENSION); - type.setProfile("#" + myExtensionDefToCode.get(nextChildExt)); - } - - } - } - } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IBoundCodeableConcept.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IBoundCodeableConcept.java new file mode 100644 index 00000000000..a1c66492627 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IBoundCodeableConcept.java @@ -0,0 +1,25 @@ +package ca.uhn.fhir.model.api; + +/* + * #%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% + */ + +public interface IBoundCodeableConcept { + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IFhirVersion.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IFhirVersion.java new file mode 100644 index 00000000000..a1b97f896a3 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IFhirVersion.java @@ -0,0 +1,35 @@ +package ca.uhn.fhir.model.api; + +/* + * #%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.context.RuntimeResourceDefinition; +import ca.uhn.fhir.rest.server.IResourceProvider; +import ca.uhn.fhir.rest.server.RestfulServer; + +public interface IFhirVersion { + + IResource generateProfile(RuntimeResourceDefinition theRuntimeResourceDefinition); + + Object createServerConformanceProvider(RestfulServer theServer); + + IResourceProvider createServerProfilesProvider(RestfulServer theRestfulServer); + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IResource.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IResource.java index c26fdee679a..69c02fcabd7 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IResource.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IResource.java @@ -24,7 +24,6 @@ import java.util.Map; import ca.uhn.fhir.model.dstu.composite.ContainedDt; import ca.uhn.fhir.model.dstu.composite.NarrativeDt; -import ca.uhn.fhir.model.dstu.resource.Patient; import ca.uhn.fhir.model.primitive.CodeDt; import ca.uhn.fhir.model.primitive.IdDt; @@ -38,7 +37,7 @@ public interface IResource extends ICompositeElement { * encoding, and copying contained resources from this list to their * appropriate references when parsing) so it is generally not neccesary to * interact with this list directly. Instead, in a server you can place - * resource instances in reference fields (such as {@link Patient#setManagingOrganization(ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt)}) + * resource instances in reference fields (such as {@link ca.uhn.fhir.model.dstu.resource.Patient#setManagingOrganization(ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt)}) * and the resource will be automatically contained. In a client, contained resources will * be automatically populated into their appropriate fields by the HAPI parser. *

diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/composite/BaseCodingDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/composite/BaseCodingDt.java index 9ec99946a8d..ae028096768 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/composite/BaseCodingDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/composite/BaseCodingDt.java @@ -25,7 +25,6 @@ import org.apache.commons.lang3.StringUtils; import ca.uhn.fhir.model.api.BaseIdentifiableElement; import ca.uhn.fhir.model.api.ICompositeDatatype; import ca.uhn.fhir.model.api.IQueryParameterType; -import ca.uhn.fhir.model.dstu.composite.CodingDt; import ca.uhn.fhir.model.primitive.CodeDt; import ca.uhn.fhir.model.primitive.UriDt; import ca.uhn.fhir.rest.param.ParameterUtil; @@ -39,7 +38,7 @@ public abstract class BaseCodingDt extends BaseIdentifiableElement implements IC * 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 abstract CodeDt getCode(); + public abstract CodeDt getCodeElement(); @Override public String getQueryParameterQualifier() { @@ -53,17 +52,17 @@ public abstract class BaseCodingDt extends BaseIdentifiableElement implements IC * Definition: The identification of the code system that defines the meaning of the symbol in the code. *

*/ - public abstract UriDt getSystem(); + public abstract UriDt getSystemElement(); /** * {@inheritDoc} */ @Override public String getValueAsQueryToken() { - if (getSystem().getValueAsString() != null) { - return ParameterUtil.escape(StringUtils.defaultString(getSystem().getValueAsString())) + '|' + ParameterUtil.escape(getCode().getValueAsString()); + if (getSystemElement().getValueAsString() != null) { + return ParameterUtil.escape(StringUtils.defaultString(getSystemElement().getValueAsString())) + '|' + ParameterUtil.escape(getCodeElement().getValueAsString()); } else { - return ParameterUtil.escape(getCode().getValueAsString()); + return ParameterUtil.escape(getCodeElement().getValueAsString()); } } @@ -82,14 +81,14 @@ public abstract class BaseCodingDt extends BaseIdentifiableElement implements IC } /** - * Returns true if this Coding has the same {@link CodingDt#getCode() Code} and {@link CodingDt#getSystem() system} (as compared by simple equals comparison). Does not compare other - * Codes (e.g. {@link CodingDt#getUse() use}) or any extensions. + * Returns true if this Coding has the same {@link ca.uhn.fhir.model.dstu.composite.InternalCodingDt#getCode() Code} and {@link ca.uhn.fhir.model.dstu.composite.InternalCodingDt#getSystem() system} (as compared by simple equals comparison). Does not compare other + * Codes (e.g. {@link ca.uhn.fhir.model.dstu.composite.InternalCodingDt#getUse() use}) or any extensions. */ public boolean matchesSystemAndCode(BaseCodingDt theCoding) { if (theCoding == null) { return false; } - return getCode().equals(theCoding.getCode()) && getSystem().equals(theCoding.getSystem()); + return getCodeElement().equals(theCoding.getCodeElement()) && getSystemElement().equals(theCoding.getSystemElement()); } /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/composite/BaseContainedDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/composite/BaseContainedDt.java new file mode 100644 index 00000000000..1aa60ac0327 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/composite/BaseContainedDt.java @@ -0,0 +1,25 @@ +package ca.uhn.fhir.model.base.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% + */ + +public class BaseContainedDt { + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/composite/BaseIdentifierDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/composite/BaseIdentifierDt.java index 3dbf76e9bb0..32647771722 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/composite/BaseIdentifierDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/composite/BaseIdentifierDt.java @@ -23,9 +23,9 @@ package ca.uhn.fhir.model.base.composite; import org.apache.commons.lang3.StringUtils; import ca.uhn.fhir.model.api.BaseIdentifiableElement; +import ca.uhn.fhir.model.api.BasePrimitive; import ca.uhn.fhir.model.api.ICompositeDatatype; import ca.uhn.fhir.model.api.IQueryParameterType; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; import ca.uhn.fhir.model.primitive.StringDt; import ca.uhn.fhir.model.primitive.UriDt; import ca.uhn.fhir.rest.param.ParameterUtil; @@ -38,83 +38,73 @@ public abstract class BaseIdentifierDt extends BaseIdentifiableElement implement } /** - * Gets the value(s) for system (The namespace for the identifier). - * creating it if it does - * not exist. Will not return null. + * 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. - *

+ *

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

*/ - public abstract UriDt getSystem() ; + public abstract UriDt getSystemElement(); /** - * Gets the value(s) for value (The value that is unique). - * creating it if it does - * not exist. Will not return null. + * 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. - *

+ *

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

*/ - public abstract StringDt getValue(); + public abstract StringDt getValueElement(); /** * {@inheritDoc} */ @Override public String getValueAsQueryToken() { - if (getSystem().getValueAsString() != null) { - return ParameterUtil.escape(StringUtils.defaultString(getSystem().getValueAsString())) + '|' + ParameterUtil.escape(getValue().getValueAsString()); - } else { - return ParameterUtil.escape(getValue().getValueAsString()); - } - } + UriDt system = (UriDt) getSystemElement(); + StringDt value = (StringDt) getValueElement(); + if (system.getValueAsString() != null) { + return ParameterUtil.escape(StringUtils.defaultString(system.getValueAsString())) + '|' + ParameterUtil.escape(value.getValueAsString()); + } else { + return ParameterUtil.escape(value.getValueAsString()); + } + } - /** - * Returns true if this identifier has the same {@link IdentifierDt#getValue() value} - * and {@link IdentifierDt#getSystem() system} (as compared by simple equals comparison). - * Does not compare other values (e.g. {@link IdentifierDt#getUse() use}) or any extensions. + * Returns true if this identifier has the same {@link ca.uhn.fhir.model.dstu.composite.IdentifierDt#getValue() value} and + * {@link ca.uhn.fhir.model.dstu.composite.IdentifierDt#getSystem() system} (as compared by simple equals comparison). Does not compare other values (e.g. + * {@link ca.uhn.fhir.model.dstu.composite.IdentifierDt#getUse() use}) or any extensions. */ public boolean matchesSystemAndValue(BaseIdentifierDt theIdentifier) { if (theIdentifier == null) { return false; } - return getValue().equals(theIdentifier.getValue()) && getSystem().equals(theIdentifier.getSystem()); + return getValueElement().equals(theIdentifier.getValueElement()) && getSystemElement().equals(theIdentifier.getSystemElement()); } - - - /** + /** * Sets the value for system (The namespace for the identifier) * - *

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

+ *

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

*/ - public abstract BaseIdentifierDt setSystem( String theUri); - - + public abstract BaseIdentifierDt setSystem(String theUri); + /** * 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. - *

+ *

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

*/ - public abstract BaseIdentifierDt setValue( String theString); - + public abstract BaseIdentifierDt setValue(String theString); + /** * {@inheritDoc} */ @Override public void setValueAsQueryToken(String theQualifier, String theParameter) { - int barIndex = ParameterUtil.nonEscapedIndexOf(theParameter,'|'); + int barIndex = ParameterUtil.nonEscapedIndexOf(theParameter, '|'); if (barIndex != -1) { setSystem(theParameter.substring(0, barIndex)); setValue(ParameterUtil.unescape(theParameter.substring(barIndex + 1))); @@ -122,5 +112,5 @@ public abstract class BaseIdentifierDt extends BaseIdentifiableElement implement setValue(ParameterUtil.unescape(theParameter)); } } - + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/composite/BaseQuantityDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/composite/BaseQuantityDt.java index deff9cd2385..bd2f6f56257 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/composite/BaseQuantityDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/composite/BaseQuantityDt.java @@ -50,7 +50,7 @@ public abstract class BaseQuantityDt extends BaseIdentifiableElement implements @Override public void setValueAsQueryToken(String theQualifier, String theValue) { - getComparator().setValue(null); + getComparatorElement().setValue(null); setCode( null); setSystem(null); setUnits( null); @@ -62,16 +62,16 @@ public abstract class BaseQuantityDt extends BaseIdentifiableElement implements String[] parts = theValue.split("\\|"); if (parts.length > 0 && StringUtils.isNotBlank(parts[0])) { if (parts[0].startsWith("<=")) { - getComparator().setValue(QuantityCompararatorEnum.LESSTHAN_OR_EQUALS.getCode()); + getComparatorElement().setValue(QuantityCompararatorEnum.LESSTHAN_OR_EQUALS.getCode()); setValue(new BigDecimal(parts[0].substring(2))); } else if (parts[0].startsWith("<")) { - getComparator().setValue(QuantityCompararatorEnum.LESSTHAN.getCode()); + getComparatorElement().setValue(QuantityCompararatorEnum.LESSTHAN.getCode()); setValue(new BigDecimal(parts[0].substring(1))); } else if (parts[0].startsWith(">=")) { - getComparator().setValue(QuantityCompararatorEnum.GREATERTHAN_OR_EQUALS.getCode()); + getComparatorElement().setValue(QuantityCompararatorEnum.GREATERTHAN_OR_EQUALS.getCode()); setValue(new BigDecimal(parts[0].substring(2))); } else if (parts[0].startsWith(">")) { - getComparator().setValue(QuantityCompararatorEnum.GREATERTHAN.getCode()); + getComparatorElement().setValue(QuantityCompararatorEnum.GREATERTHAN.getCode()); setValue(new BigDecimal(parts[0].substring(1))); } else { setValue(new BigDecimal(parts[0])); @@ -96,24 +96,24 @@ public abstract class BaseQuantityDt extends BaseIdentifiableElement implements * 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 abstract BoundCodeDt getComparator(); + public abstract BoundCodeDt getComparatorElement(); @Override public String getValueAsQueryToken() { StringBuilder b= new StringBuilder(); - if (getComparator() != null) { - b.append(getComparator().getValue()); + if (getComparatorElement() != null) { + b.append(getComparatorElement().getValue()); } - if (!getValue().isEmpty()) { - b.append(getValue().getValueAsString()); + if (!getValueElement().isEmpty()) { + b.append(getValueElement().getValueAsString()); } b.append('|'); - if (!getSystem().isEmpty()) { - b.append(getSystem().getValueAsString()); + if (!getSystemElement().isEmpty()) { + b.append(getSystemElement().getValueAsString()); } b.append('|'); - if (!getUnits().isEmpty()) { - b.append(getUnits().getValueAsString()); + if (!getUnitsElement().isEmpty()) { + b.append(getUnitsElement().getValueAsString()); } return b.toString(); @@ -150,7 +150,7 @@ public abstract class BaseQuantityDt extends BaseIdentifiableElement implements * The identification of the system that provides the coded form of the unit *

*/ - public abstract UriDt getSystem(); + public abstract UriDt getSystemElement(); @@ -174,7 +174,7 @@ public abstract class BaseQuantityDt extends BaseIdentifiableElement implements * A computer processable form of the units in some unit representation system *

*/ - public abstract CodeDt getCode(); + public abstract CodeDt getCodeElement(); /** * Sets the value for code (Coded form of the unit) @@ -195,7 +195,7 @@ public abstract class BaseQuantityDt extends BaseIdentifiableElement implements * A human-readable form of the units *

*/ - public abstract StringDt getUnits() ; + public abstract StringDt getUnitsElement() ; /** * Gets the value(s) for value (Numerical value (with implicit precision)). * creating it if it does @@ -206,5 +206,5 @@ public abstract class BaseQuantityDt extends BaseIdentifiableElement implements * The value of the measured amount. The value includes an implicit precision in the presentation of the value *

*/ - public abstract DecimalDt getValue(); + public abstract DecimalDt getValueElement(); } 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 new file mode 100644 index 00000000000..1ee8a06faa2 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/resource/BaseConformance.java @@ -0,0 +1,35 @@ +package ca.uhn.fhir.model.base.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 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; + +//@ResourceDef(name="Conformance") +public abstract class BaseConformance extends BaseResource implements IResource { + + public abstract StringDt getDescriptionElement(); + + public abstract StringDt getPublisherElement(); + +} 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 new file mode 100644 index 00000000000..ce4e55a616b --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/resource/BaseOperationOutcome.java @@ -0,0 +1,59 @@ +package ca.uhn.fhir.model.base.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.List; + +import ca.uhn.fhir.model.api.BaseIdentifiableElement; +import ca.uhn.fhir.model.api.BaseResource; +import ca.uhn.fhir.model.api.IResource; +import ca.uhn.fhir.model.api.IResourceBlock; +import ca.uhn.fhir.model.base.composite.BaseCodingDt; +import ca.uhn.fhir.model.primitive.CodeDt; +import ca.uhn.fhir.model.primitive.StringDt; + +public abstract class BaseOperationOutcome extends BaseResource implements IResource { + + public abstract BaseIssue addIssue(); + + public abstract List getIssue(); + + public abstract BaseIssue getIssueFirstRep(); + + public static abstract class BaseIssue extends BaseIdentifiableElement implements IResourceBlock { + + public abstract CodeDt getSeverityElement(); + + public abstract StringDt getDetailsElement(); + + public abstract BaseCodingDt getType(); + + public abstract BaseIssue addLocation( String theString); + + public abstract BaseIssue setDetails(String theString); + + public abstract StringDt getLocationFirstRep(); + + } + + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AdverseReaction.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AdverseReaction.java deleted file mode 100644 index b3583a7fbb5..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AdverseReaction.java +++ /dev/null @@ -1,980 +0,0 @@ - - - - - - - - - - - - - - - - -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.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.CausalityExpectationEnum; -import ca.uhn.fhir.model.dstu.valueset.ExposureTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.ReactionSeverityEnum; -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.rest.gclient.DateClientParam; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR AdverseReaction Resource - * (Specific reactions to a substance) - * - *

- * Definition: - * Records an unexpected reaction suspected to be related to the exposure of the reaction subject to a substance - *

- * - *

- * Requirements: - * Used to track reactions when it is unknown the exact cause but there's a desire to flag/track potential causes. Also used to capture reactions that are significant for inclusion in the health record or as evidence for an allergy or intolerance. - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/AdverseReaction - *

- * - */ -@ResourceDef(name="AdverseReaction", profile="http://hl7.org/fhir/profiles/AdverseReaction", id="adversereaction") -public class AdverseReaction extends BaseResource implements IResource { - - /** - * Search parameter constant for symptom - *

- * Description: One of the symptoms of the reaction
- * Type: token
- * Path: AdverseReaction.symptom.code
- *

- */ - @SearchParamDefinition(name="symptom", path="AdverseReaction.symptom.code", description="One of the symptoms of the reaction", type="token" ) - public static final String SP_SYMPTOM = "symptom"; - - /** - * Fluent Client search parameter constant for symptom - *

- * Description: One of the symptoms of the reaction
- * Type: token
- * Path: AdverseReaction.symptom.code
- *

- */ - public static final TokenClientParam SYMPTOM = new TokenClientParam(SP_SYMPTOM); - - /** - * Search parameter constant for substance - *

- * Description: The name or code of the substance that produces the sensitivity
- * Type: reference
- * Path: AdverseReaction.exposure.substance
- *

- */ - @SearchParamDefinition(name="substance", path="AdverseReaction.exposure.substance", description="The name or code of the substance that produces the sensitivity", type="reference" ) - public static final String SP_SUBSTANCE = "substance"; - - /** - * Fluent Client search parameter constant for substance - *

- * Description: The name or code of the substance that produces the sensitivity
- * Type: reference
- * Path: AdverseReaction.exposure.substance
- *

- */ - public static final ReferenceClientParam SUBSTANCE = new ReferenceClientParam(SP_SUBSTANCE); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "AdverseReaction.exposure.substance". - */ - public static final Include INCLUDE_EXPOSURE_SUBSTANCE = new Include("AdverseReaction.exposure.substance"); - - /** - * Search parameter constant for date - *

- * Description: The date of the reaction
- * Type: date
- * Path: AdverseReaction.date
- *

- */ - @SearchParamDefinition(name="date", path="AdverseReaction.date", description="The date of the reaction", type="date" ) - public static final String SP_DATE = "date"; - - /** - * Fluent Client search parameter constant for date - *

- * Description: The date of the reaction
- * Type: date
- * Path: AdverseReaction.date
- *

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

- * Description: The subject that the sensitivity is about
- * Type: reference
- * Path: AdverseReaction.subject
- *

- */ - @SearchParamDefinition(name="subject", path="AdverseReaction.subject", description="The subject that the sensitivity is about", type="reference" ) - public static final String SP_SUBJECT = "subject"; - - /** - * Fluent Client search parameter constant for subject - *

- * Description: The subject that the sensitivity is about
- * Type: reference
- * Path: AdverseReaction.subject
- *

- */ - public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "AdverseReaction.subject". - */ - public static final Include INCLUDE_SUBJECT = new Include("AdverseReaction.subject"); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="External Ids for this adverse reaction", - formalDefinition="This records identifiers associated with this reaction that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)" - ) - private java.util.List myIdentifier; - - @Child(name="date", type=DateTimeDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="When the reaction occurred", - formalDefinition="The date (and possibly time) when the reaction began" - ) - private DateTimeDt myDate; - - @Child(name="subject", order=2, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="Who had the reaction", - formalDefinition="The subject of the adverse reaction" - ) - private ResourceReferenceDt mySubject; - - @Child(name="didNotOccurFlag", type=BooleanDt.class, order=3, min=1, max=1) - @Description( - shortDefinition="Indicates lack of reaction", - formalDefinition="If true, indicates that no reaction occurred." - ) - private BooleanDt myDidNotOccurFlag; - - @Child(name="recorder", order=4, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="Who recorded the reaction", - formalDefinition="Identifies the individual responsible for the information in the reaction record." - ) - private ResourceReferenceDt myRecorder; - - @Child(name="symptom", order=5, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="What was reaction?", - formalDefinition="The signs and symptoms that were observed as part of the reaction" - ) - private java.util.List mySymptom; - - @Child(name="exposure", order=6, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Suspected substance", - formalDefinition="An exposure to a substance that preceded a reaction occurrence" - ) - private java.util.List myExposure; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myDate, mySubject, myDidNotOccurFlag, myRecorder, mySymptom, myExposure); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myDate, mySubject, myDidNotOccurFlag, myRecorder, mySymptom, myExposure); - } - - /** - * Gets the value(s) for identifier (External Ids for this adverse reaction). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * This records identifiers associated with this reaction that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (External Ids for this adverse reaction) - * - *

- * Definition: - * This records identifiers associated with this reaction that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public AdverseReaction setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (External Ids for this adverse reaction) - * - *

- * Definition: - * This records identifiers associated with this reaction that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (External Ids for this adverse reaction), - * creating it if it does not already exist. - * - *

- * Definition: - * This records identifiers associated with this reaction that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (External Ids for this adverse reaction) - * - *

- * Definition: - * This records identifiers associated with this reaction that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public AdverseReaction addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (External Ids for this adverse reaction) - * - *

- * Definition: - * This records identifiers associated with this reaction that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public AdverseReaction addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for date (When the reaction occurred). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The date (and possibly time) when the reaction began - *

- */ - public DateTimeDt getDate() { - if (myDate == null) { - myDate = new DateTimeDt(); - } - return myDate; - } - - /** - * Sets the value(s) for date (When the reaction occurred) - * - *

- * Definition: - * The date (and possibly time) when the reaction began - *

- */ - public AdverseReaction setDate(DateTimeDt theValue) { - myDate = theValue; - return this; - } - - /** - * Sets the value for date (When the reaction occurred) - * - *

- * Definition: - * The date (and possibly time) when the reaction began - *

- */ - public AdverseReaction setDateWithSecondsPrecision( Date theDate) { - myDate = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for date (When the reaction occurred) - * - *

- * Definition: - * The date (and possibly time) when the reaction began - *

- */ - public AdverseReaction setDate( Date theDate, TemporalPrecisionEnum thePrecision) { - myDate = new DateTimeDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for subject (Who had the reaction). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The subject of the adverse reaction - *

- */ - public ResourceReferenceDt getSubject() { - if (mySubject == null) { - mySubject = new ResourceReferenceDt(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (Who had the reaction) - * - *

- * Definition: - * The subject of the adverse reaction - *

- */ - public AdverseReaction setSubject(ResourceReferenceDt theValue) { - mySubject = theValue; - return this; - } - - - /** - * Gets the value(s) for didNotOccurFlag (Indicates lack of reaction). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * If true, indicates that no reaction occurred. - *

- */ - public BooleanDt getDidNotOccurFlag() { - if (myDidNotOccurFlag == null) { - myDidNotOccurFlag = new BooleanDt(); - } - return myDidNotOccurFlag; - } - - /** - * Sets the value(s) for didNotOccurFlag (Indicates lack of reaction) - * - *

- * Definition: - * If true, indicates that no reaction occurred. - *

- */ - public AdverseReaction setDidNotOccurFlag(BooleanDt theValue) { - myDidNotOccurFlag = theValue; - return this; - } - - /** - * Sets the value for didNotOccurFlag (Indicates lack of reaction) - * - *

- * Definition: - * If true, indicates that no reaction occurred. - *

- */ - public AdverseReaction setDidNotOccurFlag( boolean theBoolean) { - myDidNotOccurFlag = new BooleanDt(theBoolean); - return this; - } - - - /** - * Gets the value(s) for recorder (Who recorded the reaction). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the individual responsible for the information in the reaction record. - *

- */ - public ResourceReferenceDt getRecorder() { - if (myRecorder == null) { - myRecorder = new ResourceReferenceDt(); - } - return myRecorder; - } - - /** - * Sets the value(s) for recorder (Who recorded the reaction) - * - *

- * Definition: - * Identifies the individual responsible for the information in the reaction record. - *

- */ - public AdverseReaction setRecorder(ResourceReferenceDt theValue) { - myRecorder = theValue; - return this; - } - - - /** - * Gets the value(s) for symptom (What was reaction?). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The signs and symptoms that were observed as part of the reaction - *

- */ - public java.util.List getSymptom() { - if (mySymptom == null) { - mySymptom = new java.util.ArrayList(); - } - return mySymptom; - } - - /** - * Sets the value(s) for symptom (What was reaction?) - * - *

- * Definition: - * The signs and symptoms that were observed as part of the reaction - *

- */ - public AdverseReaction setSymptom(java.util.List theValue) { - mySymptom = theValue; - return this; - } - - /** - * Adds and returns a new value for symptom (What was reaction?) - * - *

- * Definition: - * The signs and symptoms that were observed as part of the reaction - *

- */ - public Symptom addSymptom() { - Symptom newType = new Symptom(); - getSymptom().add(newType); - return newType; - } - - /** - * Gets the first repetition for symptom (What was reaction?), - * creating it if it does not already exist. - * - *

- * Definition: - * The signs and symptoms that were observed as part of the reaction - *

- */ - public Symptom getSymptomFirstRep() { - if (getSymptom().isEmpty()) { - return addSymptom(); - } - return getSymptom().get(0); - } - - /** - * Gets the value(s) for exposure (Suspected substance). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * An exposure to a substance that preceded a reaction occurrence - *

- */ - public java.util.List getExposure() { - if (myExposure == null) { - myExposure = new java.util.ArrayList(); - } - return myExposure; - } - - /** - * Sets the value(s) for exposure (Suspected substance) - * - *

- * Definition: - * An exposure to a substance that preceded a reaction occurrence - *

- */ - public AdverseReaction setExposure(java.util.List theValue) { - myExposure = theValue; - return this; - } - - /** - * Adds and returns a new value for exposure (Suspected substance) - * - *

- * Definition: - * An exposure to a substance that preceded a reaction occurrence - *

- */ - public Exposure addExposure() { - Exposure newType = new Exposure(); - getExposure().add(newType); - return newType; - } - - /** - * Gets the first repetition for exposure (Suspected substance), - * creating it if it does not already exist. - * - *

- * Definition: - * An exposure to a substance that preceded a reaction occurrence - *

- */ - public Exposure getExposureFirstRep() { - if (getExposure().isEmpty()) { - return addExposure(); - } - return getExposure().get(0); - } - - /** - * Block class for child element: AdverseReaction.symptom (What was reaction?) - * - *

- * Definition: - * The signs and symptoms that were observed as part of the reaction - *

- */ - @Block() - public static class Symptom extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="code", type=CodeableConceptDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="E.g. Rash, vomiting", - formalDefinition="Indicates the specific sign or symptom that was observed" - ) - private CodeableConceptDt myCode; - - @Child(name="severity", type=CodeDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="severe | serious | moderate | minor", - formalDefinition="The severity of the sign or symptom" - ) - private BoundCodeDt mySeverity; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCode, mySeverity); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCode, mySeverity); - } - - /** - * Gets the value(s) for code (E.g. Rash, vomiting). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates the specific sign or symptom that was observed - *

- */ - public CodeableConceptDt getCode() { - if (myCode == null) { - myCode = new CodeableConceptDt(); - } - return myCode; - } - - /** - * Sets the value(s) for code (E.g. Rash, vomiting) - * - *

- * Definition: - * Indicates the specific sign or symptom that was observed - *

- */ - public Symptom setCode(CodeableConceptDt theValue) { - myCode = theValue; - return this; - } - - - /** - * Gets the value(s) for severity (severe | serious | moderate | minor). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The severity of the sign or symptom - *

- */ - public BoundCodeDt getSeverity() { - if (mySeverity == null) { - mySeverity = new BoundCodeDt(ReactionSeverityEnum.VALUESET_BINDER); - } - return mySeverity; - } - - /** - * Sets the value(s) for severity (severe | serious | moderate | minor) - * - *

- * Definition: - * The severity of the sign or symptom - *

- */ - public Symptom setSeverity(BoundCodeDt theValue) { - mySeverity = theValue; - return this; - } - - /** - * Sets the value(s) for severity (severe | serious | moderate | minor) - * - *

- * Definition: - * The severity of the sign or symptom - *

- */ - public Symptom setSeverity(ReactionSeverityEnum theValue) { - getSeverity().setValueAsEnum(theValue); - return this; - } - - - - } - - - /** - * Block class for child element: AdverseReaction.exposure (Suspected substance) - * - *

- * Definition: - * An exposure to a substance that preceded a reaction occurrence - *

- */ - @Block() - public static class Exposure extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="date", type=DateTimeDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="When the exposure occurred", - formalDefinition="Identifies the initial date of the exposure that is suspected to be related to the reaction" - ) - private DateTimeDt myDate; - - @Child(name="type", type=CodeDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="drugadmin | immuniz | coincidental", - formalDefinition="The type of exposure: Drug Administration, Immunization, Coincidental" - ) - private BoundCodeDt myType; - - @Child(name="causalityExpectation", type=CodeDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="likely | unlikely | confirmed | unknown", - formalDefinition="A statement of how confident that the recorder was that this exposure caused the reaction" - ) - private BoundCodeDt myCausalityExpectation; - - @Child(name="substance", order=3, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Substance.class }) - @Description( - shortDefinition="Presumed causative substance", - formalDefinition="Substance that is presumed to have caused the adverse reaction" - ) - private ResourceReferenceDt mySubstance; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myDate, myType, myCausalityExpectation, mySubstance); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myDate, myType, myCausalityExpectation, mySubstance); - } - - /** - * Gets the value(s) for date (When the exposure occurred). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the initial date of the exposure that is suspected to be related to the reaction - *

- */ - public DateTimeDt getDate() { - if (myDate == null) { - myDate = new DateTimeDt(); - } - return myDate; - } - - /** - * Sets the value(s) for date (When the exposure occurred) - * - *

- * Definition: - * Identifies the initial date of the exposure that is suspected to be related to the reaction - *

- */ - public Exposure setDate(DateTimeDt theValue) { - myDate = theValue; - return this; - } - - /** - * Sets the value for date (When the exposure occurred) - * - *

- * Definition: - * Identifies the initial date of the exposure that is suspected to be related to the reaction - *

- */ - public Exposure setDateWithSecondsPrecision( Date theDate) { - myDate = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for date (When the exposure occurred) - * - *

- * Definition: - * Identifies the initial date of the exposure that is suspected to be related to the reaction - *

- */ - public Exposure setDate( Date theDate, TemporalPrecisionEnum thePrecision) { - myDate = new DateTimeDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for type (drugadmin | immuniz | coincidental). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The type of exposure: Drug Administration, Immunization, Coincidental - *

- */ - public BoundCodeDt getType() { - if (myType == null) { - myType = new BoundCodeDt(ExposureTypeEnum.VALUESET_BINDER); - } - return myType; - } - - /** - * Sets the value(s) for type (drugadmin | immuniz | coincidental) - * - *

- * Definition: - * The type of exposure: Drug Administration, Immunization, Coincidental - *

- */ - public Exposure setType(BoundCodeDt theValue) { - myType = theValue; - return this; - } - - /** - * Sets the value(s) for type (drugadmin | immuniz | coincidental) - * - *

- * Definition: - * The type of exposure: Drug Administration, Immunization, Coincidental - *

- */ - public Exposure setType(ExposureTypeEnum theValue) { - getType().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for causalityExpectation (likely | unlikely | confirmed | unknown). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A statement of how confident that the recorder was that this exposure caused the reaction - *

- */ - public BoundCodeDt getCausalityExpectation() { - if (myCausalityExpectation == null) { - myCausalityExpectation = new BoundCodeDt(CausalityExpectationEnum.VALUESET_BINDER); - } - return myCausalityExpectation; - } - - /** - * Sets the value(s) for causalityExpectation (likely | unlikely | confirmed | unknown) - * - *

- * Definition: - * A statement of how confident that the recorder was that this exposure caused the reaction - *

- */ - public Exposure setCausalityExpectation(BoundCodeDt theValue) { - myCausalityExpectation = theValue; - return this; - } - - /** - * Sets the value(s) for causalityExpectation (likely | unlikely | confirmed | unknown) - * - *

- * Definition: - * A statement of how confident that the recorder was that this exposure caused the reaction - *

- */ - public Exposure setCausalityExpectation(CausalityExpectationEnum theValue) { - getCausalityExpectation().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for substance (Presumed causative substance). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Substance that is presumed to have caused the adverse reaction - *

- */ - public ResourceReferenceDt getSubstance() { - if (mySubstance == null) { - mySubstance = new ResourceReferenceDt(); - } - return mySubstance; - } - - /** - * Sets the value(s) for substance (Presumed causative substance) - * - *

- * Definition: - * Substance that is presumed to have caused the adverse reaction - *

- */ - public Exposure setSubstance(ResourceReferenceDt theValue) { - mySubstance = theValue; - return this; - } - - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Alert.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Alert.java deleted file mode 100644 index 22fa576dda6..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Alert.java +++ /dev/null @@ -1,446 +0,0 @@ - - - - - - - - - - - - - - - - -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.List; - -import ca.uhn.fhir.model.api.BaseResource; -import ca.uhn.fhir.model.api.IElement; -import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.api.Include; -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.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.AlertStatusEnum; -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.rest.gclient.ReferenceClientParam; - - -/** - * HAPI/FHIR Alert Resource - * (Key information to flag to healthcare providers) - * - *

- * Definition: - * Prospective warnings of potential issues when providing care to the patient - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Alert - *

- * - */ -@ResourceDef(name="Alert", profile="http://hl7.org/fhir/profiles/Alert", id="alert") -public class Alert extends BaseResource implements IResource { - - /** - * Search parameter constant for subject - *

- * Description: The identity of a subject to list alerts for
- * Type: reference
- * Path: Alert.subject
- *

- */ - @SearchParamDefinition(name="subject", path="Alert.subject", description="The identity of a subject to list alerts for", type="reference" ) - public static final String SP_SUBJECT = "subject"; - - /** - * Fluent Client search parameter constant for subject - *

- * Description: The identity of a subject to list alerts for
- * Type: reference
- * Path: Alert.subject
- *

- */ - public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Alert.subject". - */ - public static final Include INCLUDE_SUBJECT = new Include("Alert.subject"); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Business identifier", - formalDefinition="Identifier assigned to the alert for external use (outside the FHIR environment)" - ) - private java.util.List myIdentifier; - - @Child(name="category", type=CodeableConceptDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Clinical, administrative, etc.", - formalDefinition="Allows an alert to be divided into different categories like clinical, administrative etc." - ) - private CodeableConceptDt myCategory; - - @Child(name="status", type=CodeDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="active | inactive | entered in error", - formalDefinition="Supports basic workflow" - ) - private BoundCodeDt myStatus; - - @Child(name="subject", order=3, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="Who is alert about?", - formalDefinition="The person who this alert concerns" - ) - private ResourceReferenceDt mySubject; - - @Child(name="author", order=4, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.Device.class }) - @Description( - shortDefinition="Alert creator", - formalDefinition="The person or device that created the alert" - ) - private ResourceReferenceDt myAuthor; - - @Child(name="note", type=StringDt.class, order=5, min=1, max=1) - @Description( - shortDefinition="Text of alert", - formalDefinition="The textual component of the alert to display to the user" - ) - private StringDt myNote; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myCategory, myStatus, mySubject, myAuthor, myNote); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myCategory, myStatus, mySubject, myAuthor, myNote); - } - - /** - * Gets the value(s) for identifier (Business identifier). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifier assigned to the alert for external use (outside the FHIR environment) - *

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Business identifier) - * - *

- * Definition: - * Identifier assigned to the alert for external use (outside the FHIR environment) - *

- */ - public Alert setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (Business identifier) - * - *

- * Definition: - * Identifier assigned to the alert for external use (outside the FHIR environment) - *

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (Business identifier), - * creating it if it does not already exist. - * - *

- * Definition: - * Identifier assigned to the alert for external use (outside the FHIR environment) - *

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (Business identifier) - * - *

- * Definition: - * Identifier assigned to the alert for external use (outside the FHIR environment) - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Alert addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (Business identifier) - * - *

- * Definition: - * Identifier assigned to the alert for external use (outside the FHIR environment) - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Alert addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for category (Clinical, administrative, etc.). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Allows an alert to be divided into different categories like clinical, administrative etc. - *

- */ - public CodeableConceptDt getCategory() { - if (myCategory == null) { - myCategory = new CodeableConceptDt(); - } - return myCategory; - } - - /** - * Sets the value(s) for category (Clinical, administrative, etc.) - * - *

- * Definition: - * Allows an alert to be divided into different categories like clinical, administrative etc. - *

- */ - public Alert setCategory(CodeableConceptDt theValue) { - myCategory = theValue; - return this; - } - - - /** - * Gets the value(s) for status (active | inactive | entered in error). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Supports basic workflow - *

- */ - public BoundCodeDt getStatus() { - if (myStatus == null) { - myStatus = new BoundCodeDt(AlertStatusEnum.VALUESET_BINDER); - } - return myStatus; - } - - /** - * Sets the value(s) for status (active | inactive | entered in error) - * - *

- * Definition: - * Supports basic workflow - *

- */ - public Alert setStatus(BoundCodeDt theValue) { - myStatus = theValue; - return this; - } - - /** - * Sets the value(s) for status (active | inactive | entered in error) - * - *

- * Definition: - * Supports basic workflow - *

- */ - public Alert setStatus(AlertStatusEnum theValue) { - getStatus().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for subject (Who is alert about?). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The person who this alert concerns - *

- */ - public ResourceReferenceDt getSubject() { - if (mySubject == null) { - mySubject = new ResourceReferenceDt(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (Who is alert about?) - * - *

- * Definition: - * The person who this alert concerns - *

- */ - public Alert setSubject(ResourceReferenceDt theValue) { - mySubject = theValue; - return this; - } - - - /** - * Gets the value(s) for author (Alert creator). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The person or device that created the alert - *

- */ - public ResourceReferenceDt getAuthor() { - if (myAuthor == null) { - myAuthor = new ResourceReferenceDt(); - } - return myAuthor; - } - - /** - * Sets the value(s) for author (Alert creator) - * - *

- * Definition: - * The person or device that created the alert - *

- */ - public Alert setAuthor(ResourceReferenceDt theValue) { - myAuthor = theValue; - return this; - } - - - /** - * Gets the value(s) for note (Text of alert). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The textual component of the alert to display to the user - *

- */ - public StringDt getNote() { - if (myNote == null) { - myNote = new StringDt(); - } - return myNote; - } - - /** - * Sets the value(s) for note (Text of alert) - * - *

- * Definition: - * The textual component of the alert to display to the user - *

- */ - public Alert setNote(StringDt theValue) { - myNote = theValue; - return this; - } - - /** - * Sets the value for note (Text of alert) - * - *

- * Definition: - * The textual component of the alert to display to the user - *

- */ - public Alert setNote( String theString) { - myNote = new StringDt(theString); - return this; - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AllergyIntolerance.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AllergyIntolerance.java deleted file mode 100644 index af7d4a83ca9..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AllergyIntolerance.java +++ /dev/null @@ -1,788 +0,0 @@ - - - - - - - - - - - - - - - - -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.BaseResource; -import ca.uhn.fhir.model.api.IElement; -import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.api.Include; -import ca.uhn.fhir.model.api.TemporalPrecisionEnum; -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.Description; -import ca.uhn.fhir.model.api.annotation.ResourceDef; -import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.CriticalityEnum; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.SensitivityStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.SensitivityTypeEnum; -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.rest.gclient.DateClientParam; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR AllergyIntolerance Resource - * (Drug, food, environmental and others) - * - *

- * Definition: - * Indicates the patient has a susceptibility to an adverse reaction upon exposure to a specified substance - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/AllergyIntolerance - *

- * - */ -@ResourceDef(name="AllergyIntolerance", profile="http://hl7.org/fhir/profiles/AllergyIntolerance", id="allergyintolerance") -public class AllergyIntolerance extends BaseResource implements IResource { - - /** - * Search parameter constant for type - *

- * Description: The type of sensitivity
- * Type: token
- * Path: AllergyIntolerance.sensitivityType
- *

- */ - @SearchParamDefinition(name="type", path="AllergyIntolerance.sensitivityType", description="The type of sensitivity", type="token" ) - public static final String SP_TYPE = "type"; - - /** - * Fluent Client search parameter constant for type - *

- * Description: The type of sensitivity
- * Type: token
- * Path: AllergyIntolerance.sensitivityType
- *

- */ - public static final TokenClientParam TYPE = new TokenClientParam(SP_TYPE); - - /** - * Search parameter constant for substance - *

- * Description: The name or code of the substance that produces the sensitivity
- * Type: reference
- * Path: AllergyIntolerance.substance
- *

- */ - @SearchParamDefinition(name="substance", path="AllergyIntolerance.substance", description="The name or code of the substance that produces the sensitivity", type="reference" ) - public static final String SP_SUBSTANCE = "substance"; - - /** - * Fluent Client search parameter constant for substance - *

- * Description: The name or code of the substance that produces the sensitivity
- * Type: reference
- * Path: AllergyIntolerance.substance
- *

- */ - public static final ReferenceClientParam SUBSTANCE = new ReferenceClientParam(SP_SUBSTANCE); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "AllergyIntolerance.substance". - */ - public static final Include INCLUDE_SUBSTANCE = new Include("AllergyIntolerance.substance"); - - /** - * Search parameter constant for date - *

- * Description: Recorded date/time.
- * Type: date
- * Path: AllergyIntolerance.recordedDate
- *

- */ - @SearchParamDefinition(name="date", path="AllergyIntolerance.recordedDate", description="Recorded date/time.", type="date" ) - public static final String SP_DATE = "date"; - - /** - * Fluent Client search parameter constant for date - *

- * Description: Recorded date/time.
- * Type: date
- * Path: AllergyIntolerance.recordedDate
- *

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

- * Description: The status of the sensitivity
- * Type: token
- * Path: AllergyIntolerance.status
- *

- */ - @SearchParamDefinition(name="status", path="AllergyIntolerance.status", description="The status of the sensitivity", type="token" ) - public static final String SP_STATUS = "status"; - - /** - * Fluent Client search parameter constant for status - *

- * Description: The status of the sensitivity
- * Type: token
- * Path: AllergyIntolerance.status
- *

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

- * Description: The subject that the sensitivity is about
- * Type: reference
- * Path: AllergyIntolerance.subject
- *

- */ - @SearchParamDefinition(name="subject", path="AllergyIntolerance.subject", description="The subject that the sensitivity is about", type="reference" ) - public static final String SP_SUBJECT = "subject"; - - /** - * Fluent Client search parameter constant for subject - *

- * Description: The subject that the sensitivity is about
- * Type: reference
- * Path: AllergyIntolerance.subject
- *

- */ - public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "AllergyIntolerance.subject". - */ - public static final Include INCLUDE_SUBJECT = new Include("AllergyIntolerance.subject"); - - /** - * Search parameter constant for recorder - *

- * Description: Who recorded the sensitivity
- * Type: reference
- * Path: AllergyIntolerance.recorder
- *

- */ - @SearchParamDefinition(name="recorder", path="AllergyIntolerance.recorder", description="Who recorded the sensitivity", type="reference" ) - public static final String SP_RECORDER = "recorder"; - - /** - * Fluent Client search parameter constant for recorder - *

- * Description: Who recorded the sensitivity
- * Type: reference
- * Path: AllergyIntolerance.recorder
- *

- */ - public static final ReferenceClientParam RECORDER = new ReferenceClientParam(SP_RECORDER); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "AllergyIntolerance.recorder". - */ - public static final Include INCLUDE_RECORDER = new Include("AllergyIntolerance.recorder"); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="External Ids for this item", - formalDefinition="This records identifiers associated with this allergy/intolerance concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)" - ) - private java.util.List myIdentifier; - - @Child(name="criticality", type=CodeDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="fatal | high | medium | low", - formalDefinition="Criticality of the sensitivity" - ) - private BoundCodeDt myCriticality; - - @Child(name="sensitivityType", type=CodeDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="allergy | intolerance | unknown", - formalDefinition="Type of the sensitivity" - ) - private BoundCodeDt mySensitivityType; - - @Child(name="recordedDate", type=DateTimeDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="When recorded", - formalDefinition="Date when the sensitivity was recorded" - ) - private DateTimeDt myRecordedDate; - - @Child(name="status", type=CodeDt.class, order=4, min=1, max=1) - @Description( - shortDefinition="suspected | confirmed | refuted | resolved", - formalDefinition="Status of the sensitivity" - ) - private BoundCodeDt myStatus; - - @Child(name="subject", order=5, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="Who the sensitivity is for", - formalDefinition="The patient who has the allergy or intolerance" - ) - private ResourceReferenceDt mySubject; - - @Child(name="recorder", order=6, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="Who recorded the sensitivity", - formalDefinition="Indicates who has responsibility for the record" - ) - private ResourceReferenceDt myRecorder; - - @Child(name="substance", order=7, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Substance.class }) - @Description( - shortDefinition="The substance that causes the sensitivity", - formalDefinition="The substance that causes the sensitivity" - ) - private ResourceReferenceDt mySubstance; - - @Child(name="reaction", order=8, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.AdverseReaction.class }) - @Description( - shortDefinition="Reactions associated with the sensitivity", - formalDefinition="Reactions associated with the sensitivity" - ) - private java.util.List myReaction; - - @Child(name="sensitivityTest", order=9, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Observation.class }) - @Description( - shortDefinition="Observations that confirm or refute", - formalDefinition="Observations that confirm or refute the sensitivity" - ) - private java.util.List mySensitivityTest; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myCriticality, mySensitivityType, myRecordedDate, myStatus, mySubject, myRecorder, mySubstance, myReaction, mySensitivityTest); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myCriticality, mySensitivityType, myRecordedDate, myStatus, mySubject, myRecorder, mySubstance, myReaction, mySensitivityTest); - } - - /** - * Gets the value(s) for identifier (External Ids for this item). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * This records identifiers associated with this allergy/intolerance concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (External Ids for this item) - * - *

- * Definition: - * This records identifiers associated with this allergy/intolerance concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public AllergyIntolerance setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (External Ids for this item) - * - *

- * Definition: - * This records identifiers associated with this allergy/intolerance concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (External Ids for this item), - * creating it if it does not already exist. - * - *

- * Definition: - * This records identifiers associated with this allergy/intolerance concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (External Ids for this item) - * - *

- * Definition: - * This records identifiers associated with this allergy/intolerance concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public AllergyIntolerance addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (External Ids for this item) - * - *

- * Definition: - * This records identifiers associated with this allergy/intolerance concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public AllergyIntolerance addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for criticality (fatal | high | medium | low). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Criticality of the sensitivity - *

- */ - public BoundCodeDt getCriticality() { - if (myCriticality == null) { - myCriticality = new BoundCodeDt(CriticalityEnum.VALUESET_BINDER); - } - return myCriticality; - } - - /** - * Sets the value(s) for criticality (fatal | high | medium | low) - * - *

- * Definition: - * Criticality of the sensitivity - *

- */ - public AllergyIntolerance setCriticality(BoundCodeDt theValue) { - myCriticality = theValue; - return this; - } - - /** - * Sets the value(s) for criticality (fatal | high | medium | low) - * - *

- * Definition: - * Criticality of the sensitivity - *

- */ - public AllergyIntolerance setCriticality(CriticalityEnum theValue) { - getCriticality().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for sensitivityType (allergy | intolerance | unknown). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Type of the sensitivity - *

- */ - public BoundCodeDt getSensitivityType() { - if (mySensitivityType == null) { - mySensitivityType = new BoundCodeDt(SensitivityTypeEnum.VALUESET_BINDER); - } - return mySensitivityType; - } - - /** - * Sets the value(s) for sensitivityType (allergy | intolerance | unknown) - * - *

- * Definition: - * Type of the sensitivity - *

- */ - public AllergyIntolerance setSensitivityType(BoundCodeDt theValue) { - mySensitivityType = theValue; - return this; - } - - /** - * Sets the value(s) for sensitivityType (allergy | intolerance | unknown) - * - *

- * Definition: - * Type of the sensitivity - *

- */ - public AllergyIntolerance setSensitivityType(SensitivityTypeEnum theValue) { - getSensitivityType().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for recordedDate (When recorded). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Date when the sensitivity was recorded - *

- */ - public DateTimeDt getRecordedDate() { - if (myRecordedDate == null) { - myRecordedDate = new DateTimeDt(); - } - return myRecordedDate; - } - - /** - * Sets the value(s) for recordedDate (When recorded) - * - *

- * Definition: - * Date when the sensitivity was recorded - *

- */ - public AllergyIntolerance setRecordedDate(DateTimeDt theValue) { - myRecordedDate = theValue; - return this; - } - - /** - * Sets the value for recordedDate (When recorded) - * - *

- * Definition: - * Date when the sensitivity was recorded - *

- */ - public AllergyIntolerance setRecordedDateWithSecondsPrecision( Date theDate) { - myRecordedDate = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for recordedDate (When recorded) - * - *

- * Definition: - * Date when the sensitivity was recorded - *

- */ - public AllergyIntolerance setRecordedDate( Date theDate, TemporalPrecisionEnum thePrecision) { - myRecordedDate = new DateTimeDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for status (suspected | confirmed | refuted | resolved). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Status of the sensitivity - *

- */ - public BoundCodeDt getStatus() { - if (myStatus == null) { - myStatus = new BoundCodeDt(SensitivityStatusEnum.VALUESET_BINDER); - } - return myStatus; - } - - /** - * Sets the value(s) for status (suspected | confirmed | refuted | resolved) - * - *

- * Definition: - * Status of the sensitivity - *

- */ - public AllergyIntolerance setStatus(BoundCodeDt theValue) { - myStatus = theValue; - return this; - } - - /** - * Sets the value(s) for status (suspected | confirmed | refuted | resolved) - * - *

- * Definition: - * Status of the sensitivity - *

- */ - public AllergyIntolerance setStatus(SensitivityStatusEnum theValue) { - getStatus().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for subject (Who the sensitivity is for). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The patient who has the allergy or intolerance - *

- */ - public ResourceReferenceDt getSubject() { - if (mySubject == null) { - mySubject = new ResourceReferenceDt(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (Who the sensitivity is for) - * - *

- * Definition: - * The patient who has the allergy or intolerance - *

- */ - public AllergyIntolerance setSubject(ResourceReferenceDt theValue) { - mySubject = theValue; - return this; - } - - - /** - * Gets the value(s) for recorder (Who recorded the sensitivity). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates who has responsibility for the record - *

- */ - public ResourceReferenceDt getRecorder() { - if (myRecorder == null) { - myRecorder = new ResourceReferenceDt(); - } - return myRecorder; - } - - /** - * Sets the value(s) for recorder (Who recorded the sensitivity) - * - *

- * Definition: - * Indicates who has responsibility for the record - *

- */ - public AllergyIntolerance setRecorder(ResourceReferenceDt theValue) { - myRecorder = theValue; - return this; - } - - - /** - * Gets the value(s) for substance (The substance that causes the sensitivity). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The substance that causes the sensitivity - *

- */ - public ResourceReferenceDt getSubstance() { - if (mySubstance == null) { - mySubstance = new ResourceReferenceDt(); - } - return mySubstance; - } - - /** - * Sets the value(s) for substance (The substance that causes the sensitivity) - * - *

- * Definition: - * The substance that causes the sensitivity - *

- */ - public AllergyIntolerance setSubstance(ResourceReferenceDt theValue) { - mySubstance = theValue; - return this; - } - - - /** - * Gets the value(s) for reaction (Reactions associated with the sensitivity). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Reactions associated with the sensitivity - *

- */ - public java.util.List getReaction() { - if (myReaction == null) { - myReaction = new java.util.ArrayList(); - } - return myReaction; - } - - /** - * Sets the value(s) for reaction (Reactions associated with the sensitivity) - * - *

- * Definition: - * Reactions associated with the sensitivity - *

- */ - public AllergyIntolerance setReaction(java.util.List theValue) { - myReaction = theValue; - return this; - } - - /** - * Adds and returns a new value for reaction (Reactions associated with the sensitivity) - * - *

- * Definition: - * Reactions associated with the sensitivity - *

- */ - public ResourceReferenceDt addReaction() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getReaction().add(newType); - return newType; - } - - /** - * Gets the value(s) for sensitivityTest (Observations that confirm or refute). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Observations that confirm or refute the sensitivity - *

- */ - public java.util.List getSensitivityTest() { - if (mySensitivityTest == null) { - mySensitivityTest = new java.util.ArrayList(); - } - return mySensitivityTest; - } - - /** - * Sets the value(s) for sensitivityTest (Observations that confirm or refute) - * - *

- * Definition: - * Observations that confirm or refute the sensitivity - *

- */ - public AllergyIntolerance setSensitivityTest(java.util.List theValue) { - mySensitivityTest = theValue; - return this; - } - - /** - * Adds and returns a new value for sensitivityTest (Observations that confirm or refute) - * - *

- * Definition: - * Observations that confirm or refute the sensitivity - *

- */ - public ResourceReferenceDt addSensitivityTest() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getSensitivityTest().add(newType); - return newType; - } - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Appointment.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Appointment.java deleted file mode 100644 index fc96dbf6bf9..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Appointment.java +++ /dev/null @@ -1,1355 +0,0 @@ - - - - - - - - - - - - - - - - -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.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.composite.ScheduleDt; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.ParticipantTypeEnum; -import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; -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.IntegerDt; -import ca.uhn.fhir.model.primitive.StringDt; -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 Appointment Resource - * ((informative) A scheduled appointment for a patient and/or practitioner(s) where a service may take place) - * - *

- * Definition: - * A scheduled appointment for a patient and/or practitioner(s) where a service may take place. - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Appointment - *

- * - */ -@ResourceDef(name="Appointment", profile="http://hl7.org/fhir/profiles/Appointment", id="appointment") -public class Appointment extends BaseResource implements IResource { - - /** - * Search parameter constant for date - *

- * Description: Appointment date/time.
- * Type: date
- * Path: Appointment.start
- *

- */ - @SearchParamDefinition(name="date", path="Appointment.start", description="Appointment date/time.", type="date" ) - public static final String SP_DATE = "date"; - - /** - * Fluent Client search parameter constant for date - *

- * Description: Appointment date/time.
- * Type: date
- * Path: Appointment.start
- *

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

- * Description: The overall status of the appointment
- * Type: string
- * Path: Appointment.status
- *

- */ - @SearchParamDefinition(name="status", path="Appointment.status", description="The overall status of the appointment", type="string" ) - public static final String SP_STATUS = "status"; - - /** - * Fluent Client search parameter constant for status - *

- * Description: The overall status of the appointment
- * Type: string
- * Path: Appointment.status
- *

- */ - public static final StringClientParam STATUS = new StringClientParam(SP_STATUS); - - /** - * Search parameter constant for subject - *

- * Description: The subject that the sensitivity is about
- * Type: reference
- * Path: Appointment.participant.individual
- *

- */ - @SearchParamDefinition(name="subject", path="Appointment.participant.individual", description="The subject that the sensitivity is about", type="reference" ) - public static final String SP_SUBJECT = "subject"; - - /** - * Fluent Client search parameter constant for subject - *

- * Description: The subject that the sensitivity is about
- * Type: reference
- * Path: Appointment.participant.individual
- *

- */ - public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Appointment.participant.individual". - */ - public static final Include INCLUDE_PARTICIPANT_INDIVIDUAL = new Include("Appointment.participant.individual"); - - /** - * Search parameter constant for partstatus - *

- * Description: The Participation status of the subject, or other participant on the appointment
- * Type: token
- * Path: Appointment.participant.status
- *

- */ - @SearchParamDefinition(name="partstatus", path="Appointment.participant.status", description="The Participation status of the subject, or other participant on the appointment ", type="token" ) - public static final String SP_PARTSTATUS = "partstatus"; - - /** - * Fluent Client search parameter constant for partstatus - *

- * Description: The Participation status of the subject, or other participant on the appointment
- * Type: token
- * Path: Appointment.participant.status
- *

- */ - public static final TokenClientParam PARTSTATUS = new TokenClientParam(SP_PARTSTATUS); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="External Ids for this item", - formalDefinition="This records identifiers associated with this appointment concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)" - ) - private java.util.List myIdentifier; - - @Child(name="priority", type=IntegerDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority) (Need to change back to CodeableConcept)", - formalDefinition="" - ) - private IntegerDt myPriority; - - @Child(name="status", type=CodeDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="The overall status of the Appointment", - formalDefinition="Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status" - ) - private CodeDt myStatus; - - @Child(name="description", type=StringDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field", - formalDefinition="" - ) - private StringDt myDescription; - - @Child(name="start", type=InstantDt.class, order=4, min=1, max=1) - @Description( - shortDefinition="Date/Time that the appointment is to take place", - formalDefinition="" - ) - private InstantDt myStart; - - @Child(name="end", type=InstantDt.class, order=5, min=1, max=1) - @Description( - shortDefinition="Date/Time that the appointment is to conclude", - formalDefinition="" - ) - private InstantDt myEnd; - - @Child(name="schedule", type=ScheduleDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="The recurrence schedule for the appointment. The end date in the schedule marks the end of the recurrence(s), not the end of an individual appointment", - formalDefinition="" - ) - private ScheduleDt mySchedule; - - @Child(name="timezone", type=StringDt.class, order=7, min=0, max=1) - @Description( - shortDefinition="The timezone that the times are to be converted to. Required for recurring appointments to remain accurate where the schedule makes the appointment cross a daylight saving boundry", - formalDefinition="The timezone should be a value referenced from a timezone database" - ) - private StringDt myTimezone; - - @Child(name="slot", order=8, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Slot.class }) - @Description( - shortDefinition="The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot", - formalDefinition="" - ) - private java.util.List mySlot; - - @Child(name="location", order=9, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Location.class }) - @Description( - shortDefinition="The primary location that this appointment is to take place", - formalDefinition="" - ) - private ResourceReferenceDt myLocation; - - @Child(name="comment", type=StringDt.class, order=10, min=0, max=1) - @Description( - shortDefinition="Additional comments about the appointment", - formalDefinition="" - ) - private StringDt myComment; - - @Child(name="order", order=11, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Order.class }) - @Description( - shortDefinition="An Order that lead to the creation of this appointment", - formalDefinition="" - ) - private ResourceReferenceDt myOrder; - - @Child(name="participant", order=12, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="List of participants involved in the appointment", - formalDefinition="" - ) - private java.util.List myParticipant; - - @Child(name="recorder", order=13, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.RelatedPerson.class }) - @Description( - shortDefinition="Who recorded the appointment", - formalDefinition="" - ) - private ResourceReferenceDt myRecorder; - - @Child(name="recordedDate", type=DateTimeDt.class, order=14, min=0, max=1) - @Description( - shortDefinition="Date when the sensitivity was recorded", - formalDefinition="" - ) - private DateTimeDt myRecordedDate; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myPriority, myStatus, myDescription, myStart, myEnd, mySchedule, myTimezone, mySlot, myLocation, myComment, myOrder, myParticipant, myRecorder, myRecordedDate); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myPriority, myStatus, myDescription, myStart, myEnd, mySchedule, myTimezone, mySlot, myLocation, myComment, myOrder, myParticipant, myRecorder, myRecordedDate); - } - - /** - * Gets the value(s) for identifier (External Ids for this item). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * This records identifiers associated with this appointment concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (External Ids for this item) - * - *

- * Definition: - * This records identifiers associated with this appointment concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public Appointment setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (External Ids for this item) - * - *

- * Definition: - * This records identifiers associated with this appointment concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (External Ids for this item), - * creating it if it does not already exist. - * - *

- * Definition: - * This records identifiers associated with this appointment concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (External Ids for this item) - * - *

- * Definition: - * This records identifiers associated with this appointment concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Appointment addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (External Ids for this item) - * - *

- * Definition: - * This records identifiers associated with this appointment concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Appointment addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for priority (The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority) (Need to change back to CodeableConcept)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public IntegerDt getPriority() { - if (myPriority == null) { - myPriority = new IntegerDt(); - } - return myPriority; - } - - /** - * Sets the value(s) for priority (The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority) (Need to change back to CodeableConcept)) - * - *

- * Definition: - * - *

- */ - public Appointment setPriority(IntegerDt theValue) { - myPriority = theValue; - return this; - } - - /** - * Sets the value for priority (The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority) (Need to change back to CodeableConcept)) - * - *

- * Definition: - * - *

- */ - public Appointment setPriority( int theInteger) { - myPriority = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for status (The overall status of the Appointment). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status - *

- */ - public CodeDt getStatus() { - if (myStatus == null) { - myStatus = new CodeDt(); - } - return myStatus; - } - - /** - * Sets the value(s) for status (The overall status of the Appointment) - * - *

- * Definition: - * Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status - *

- */ - public Appointment setStatus(CodeDt theValue) { - myStatus = theValue; - return this; - } - - /** - * Sets the value for status (The overall status of the Appointment) - * - *

- * Definition: - * Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status - *

- */ - public Appointment setStatus( String theCode) { - myStatus = new CodeDt(theCode); - return this; - } - - - /** - * Gets the value(s) for description (The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public StringDt getDescription() { - if (myDescription == null) { - myDescription = new StringDt(); - } - return myDescription; - } - - /** - * Sets the value(s) for description (The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field) - * - *

- * Definition: - * - *

- */ - public Appointment setDescription(StringDt theValue) { - myDescription = theValue; - return this; - } - - /** - * Sets the value for description (The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field) - * - *

- * Definition: - * - *

- */ - public Appointment setDescription( String theString) { - myDescription = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for start (Date/Time that the appointment is to take place). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public InstantDt getStart() { - if (myStart == null) { - myStart = new InstantDt(); - } - return myStart; - } - - /** - * Sets the value(s) for start (Date/Time that the appointment is to take place) - * - *

- * Definition: - * - *

- */ - public Appointment setStart(InstantDt theValue) { - myStart = theValue; - return this; - } - - /** - * Sets the value for start (Date/Time that the appointment is to take place) - * - *

- * Definition: - * - *

- */ - public Appointment setStart( Date theDate, TemporalPrecisionEnum thePrecision) { - myStart = new InstantDt(theDate, thePrecision); - return this; - } - - /** - * Sets the value for start (Date/Time that the appointment is to take place) - * - *

- * Definition: - * - *

- */ - public Appointment setStartWithMillisPrecision( Date theDate) { - myStart = new InstantDt(theDate); - return this; - } - - - /** - * Gets the value(s) for end (Date/Time that the appointment is to conclude). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public InstantDt getEnd() { - if (myEnd == null) { - myEnd = new InstantDt(); - } - return myEnd; - } - - /** - * Sets the value(s) for end (Date/Time that the appointment is to conclude) - * - *

- * Definition: - * - *

- */ - public Appointment setEnd(InstantDt theValue) { - myEnd = theValue; - return this; - } - - /** - * Sets the value for end (Date/Time that the appointment is to conclude) - * - *

- * Definition: - * - *

- */ - public Appointment setEnd( Date theDate, TemporalPrecisionEnum thePrecision) { - myEnd = new InstantDt(theDate, thePrecision); - return this; - } - - /** - * Sets the value for end (Date/Time that the appointment is to conclude) - * - *

- * Definition: - * - *

- */ - public Appointment setEndWithMillisPrecision( Date theDate) { - myEnd = new InstantDt(theDate); - return this; - } - - - /** - * Gets the value(s) for schedule (The recurrence schedule for the appointment. The end date in the schedule marks the end of the recurrence(s), not the end of an individual appointment). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ScheduleDt getSchedule() { - if (mySchedule == null) { - mySchedule = new ScheduleDt(); - } - return mySchedule; - } - - /** - * Sets the value(s) for schedule (The recurrence schedule for the appointment. The end date in the schedule marks the end of the recurrence(s), not the end of an individual appointment) - * - *

- * Definition: - * - *

- */ - public Appointment setSchedule(ScheduleDt theValue) { - mySchedule = theValue; - return this; - } - - - /** - * Gets the value(s) for timezone (The timezone that the times are to be converted to. Required for recurring appointments to remain accurate where the schedule makes the appointment cross a daylight saving boundry). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The timezone should be a value referenced from a timezone database - *

- */ - public StringDt getTimezone() { - if (myTimezone == null) { - myTimezone = new StringDt(); - } - return myTimezone; - } - - /** - * Sets the value(s) for timezone (The timezone that the times are to be converted to. Required for recurring appointments to remain accurate where the schedule makes the appointment cross a daylight saving boundry) - * - *

- * Definition: - * The timezone should be a value referenced from a timezone database - *

- */ - public Appointment setTimezone(StringDt theValue) { - myTimezone = theValue; - return this; - } - - /** - * Sets the value for timezone (The timezone that the times are to be converted to. Required for recurring appointments to remain accurate where the schedule makes the appointment cross a daylight saving boundry) - * - *

- * Definition: - * The timezone should be a value referenced from a timezone database - *

- */ - public Appointment setTimezone( String theString) { - myTimezone = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for slot (The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getSlot() { - if (mySlot == null) { - mySlot = new java.util.ArrayList(); - } - return mySlot; - } - - /** - * Sets the value(s) for slot (The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot) - * - *

- * Definition: - * - *

- */ - public Appointment setSlot(java.util.List theValue) { - mySlot = theValue; - return this; - } - - /** - * Adds and returns a new value for slot (The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot) - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt addSlot() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getSlot().add(newType); - return newType; - } - - /** - * Gets the value(s) for location (The primary location that this appointment is to take place). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt getLocation() { - if (myLocation == null) { - myLocation = new ResourceReferenceDt(); - } - return myLocation; - } - - /** - * Sets the value(s) for location (The primary location that this appointment is to take place) - * - *

- * Definition: - * - *

- */ - public Appointment setLocation(ResourceReferenceDt theValue) { - myLocation = theValue; - return this; - } - - - /** - * Gets the value(s) for comment (Additional comments about the appointment). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public StringDt getComment() { - if (myComment == null) { - myComment = new StringDt(); - } - return myComment; - } - - /** - * Sets the value(s) for comment (Additional comments about the appointment) - * - *

- * Definition: - * - *

- */ - public Appointment setComment(StringDt theValue) { - myComment = theValue; - return this; - } - - /** - * Sets the value for comment (Additional comments about the appointment) - * - *

- * Definition: - * - *

- */ - public Appointment setComment( String theString) { - myComment = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for order (An Order that lead to the creation of this appointment). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt getOrder() { - if (myOrder == null) { - myOrder = new ResourceReferenceDt(); - } - return myOrder; - } - - /** - * Sets the value(s) for order (An Order that lead to the creation of this appointment) - * - *

- * Definition: - * - *

- */ - public Appointment setOrder(ResourceReferenceDt theValue) { - myOrder = theValue; - return this; - } - - - /** - * Gets the value(s) for participant (List of participants involved in the appointment). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getParticipant() { - if (myParticipant == null) { - myParticipant = new java.util.ArrayList(); - } - return myParticipant; - } - - /** - * Sets the value(s) for participant (List of participants involved in the appointment) - * - *

- * Definition: - * - *

- */ - public Appointment setParticipant(java.util.List theValue) { - myParticipant = theValue; - return this; - } - - /** - * Adds and returns a new value for participant (List of participants involved in the appointment) - * - *

- * Definition: - * - *

- */ - public Participant addParticipant() { - Participant newType = new Participant(); - getParticipant().add(newType); - return newType; - } - - /** - * Gets the first repetition for participant (List of participants involved in the appointment), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public Participant getParticipantFirstRep() { - if (getParticipant().isEmpty()) { - return addParticipant(); - } - return getParticipant().get(0); - } - - /** - * Gets the value(s) for recorder (Who recorded the appointment). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt getRecorder() { - if (myRecorder == null) { - myRecorder = new ResourceReferenceDt(); - } - return myRecorder; - } - - /** - * Sets the value(s) for recorder (Who recorded the appointment) - * - *

- * Definition: - * - *

- */ - public Appointment setRecorder(ResourceReferenceDt theValue) { - myRecorder = theValue; - return this; - } - - - /** - * Gets the value(s) for recordedDate (Date when the sensitivity was recorded). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public DateTimeDt getRecordedDate() { - if (myRecordedDate == null) { - myRecordedDate = new DateTimeDt(); - } - return myRecordedDate; - } - - /** - * Sets the value(s) for recordedDate (Date when the sensitivity was recorded) - * - *

- * Definition: - * - *

- */ - public Appointment setRecordedDate(DateTimeDt theValue) { - myRecordedDate = theValue; - return this; - } - - /** - * Sets the value for recordedDate (Date when the sensitivity was recorded) - * - *

- * Definition: - * - *

- */ - public Appointment setRecordedDateWithSecondsPrecision( Date theDate) { - myRecordedDate = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for recordedDate (Date when the sensitivity was recorded) - * - *

- * Definition: - * - *

- */ - public Appointment setRecordedDate( Date theDate, TemporalPrecisionEnum thePrecision) { - myRecordedDate = new DateTimeDt(theDate, thePrecision); - return this; - } - - - /** - * Block class for child element: Appointment.participant (List of participants involved in the appointment) - * - *

- * Definition: - * - *

- */ - @Block() - public static class Participant extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="type", type=CodeableConceptDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Role of participant in the appointment", - formalDefinition="" - ) - private java.util.List> myType; - - @Child(name="individual", order=1, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.RelatedPerson.class, ca.uhn.fhir.model.dstu.resource.Device.class }) - @Description( - shortDefinition="A Person of device that is participating in the appointment", - formalDefinition="" - ) - private java.util.List myIndividual; - - @Child(name="required", type=CodeDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="required | optional | information-only", - formalDefinition="Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present." - ) - private CodeDt myRequired; - - @Child(name="status", type=CodeDt.class, order=3, min=1, max=1) - @Description( - shortDefinition="accepted | declined | tentative | in-process | completed | needs-action", - formalDefinition="Participation status of the Patient" - ) - private CodeDt myStatus; - - @Child(name="observation", order=4, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Observation.class }) - @Description( - shortDefinition="Observations that lead to the creation of this appointment. (Is this 80%)", - formalDefinition="" - ) - private java.util.List myObservation; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myType, myIndividual, myRequired, myStatus, myObservation); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myType, myIndividual, myRequired, myStatus, myObservation); - } - - /** - * Gets the value(s) for type (Role of participant in the appointment). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List> getType() { - if (myType == null) { - myType = new java.util.ArrayList>(); - } - return myType; - } - - /** - * Sets the value(s) for type (Role of participant in the appointment) - * - *

- * Definition: - * - *

- */ - public Participant setType(java.util.List> theValue) { - myType = theValue; - return this; - } - - /** - * Add a value for type (Role of participant in the appointment) 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: - * - *

- */ - public BoundCodeableConceptDt addType(ParticipantTypeEnum theValue) { - BoundCodeableConceptDt retVal = new BoundCodeableConceptDt(ParticipantTypeEnum.VALUESET_BINDER, theValue); - getType().add(retVal); - return retVal; - } - - /** - * Gets the first repetition for type (Role of participant in the appointment), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public BoundCodeableConceptDt getTypeFirstRep() { - if (getType().size() == 0) { - addType(); - } - return getType().get(0); - } - - /** - * Add a value for type (Role of participant in the appointment) - * - *

- * Definition: - * - *

- */ - public BoundCodeableConceptDt addType() { - BoundCodeableConceptDt retVal = new BoundCodeableConceptDt(ParticipantTypeEnum.VALUESET_BINDER); - getType().add(retVal); - return retVal; - } - - /** - * Sets the value(s), and clears any existing value(s) for type (Role of participant in the appointment) - * - *

- * Definition: - * - *

- */ - public Participant setType(ParticipantTypeEnum theValue) { - getType().clear(); - addType(theValue); - return this; - } - - - /** - * Gets the value(s) for individual (A Person of device that is participating in the appointment). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getIndividual() { - if (myIndividual == null) { - myIndividual = new java.util.ArrayList(); - } - return myIndividual; - } - - /** - * Sets the value(s) for individual (A Person of device that is participating in the appointment) - * - *

- * Definition: - * - *

- */ - public Participant setIndividual(java.util.List theValue) { - myIndividual = theValue; - return this; - } - - /** - * Adds and returns a new value for individual (A Person of device that is participating in the appointment) - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt addIndividual() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getIndividual().add(newType); - return newType; - } - - /** - * Gets the value(s) for required (required | optional | information-only). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present. - *

- */ - public CodeDt getRequired() { - if (myRequired == null) { - myRequired = new CodeDt(); - } - return myRequired; - } - - /** - * Sets the value(s) for required (required | optional | information-only) - * - *

- * Definition: - * Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present. - *

- */ - public Participant setRequired(CodeDt theValue) { - myRequired = theValue; - return this; - } - - /** - * Sets the value for required (required | optional | information-only) - * - *

- * Definition: - * Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present. - *

- */ - public Participant setRequired( String theCode) { - myRequired = new CodeDt(theCode); - return this; - } - - - /** - * Gets the value(s) for status (accepted | declined | tentative | in-process | completed | needs-action). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Participation status of the Patient - *

- */ - public CodeDt getStatus() { - if (myStatus == null) { - myStatus = new CodeDt(); - } - return myStatus; - } - - /** - * Sets the value(s) for status (accepted | declined | tentative | in-process | completed | needs-action) - * - *

- * Definition: - * Participation status of the Patient - *

- */ - public Participant setStatus(CodeDt theValue) { - myStatus = theValue; - return this; - } - - /** - * Sets the value for status (accepted | declined | tentative | in-process | completed | needs-action) - * - *

- * Definition: - * Participation status of the Patient - *

- */ - public Participant setStatus( String theCode) { - myStatus = new CodeDt(theCode); - return this; - } - - - /** - * Gets the value(s) for observation (Observations that lead to the creation of this appointment. (Is this 80%)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getObservation() { - if (myObservation == null) { - myObservation = new java.util.ArrayList(); - } - return myObservation; - } - - /** - * Sets the value(s) for observation (Observations that lead to the creation of this appointment. (Is this 80%)) - * - *

- * Definition: - * - *

- */ - public Participant setObservation(java.util.List theValue) { - myObservation = theValue; - return this; - } - - /** - * Adds and returns a new value for observation (Observations that lead to the creation of this appointment. (Is this 80%)) - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt addObservation() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getObservation().add(newType); - return newType; - } - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AppointmentResponse.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AppointmentResponse.java deleted file mode 100644 index b946d191cb6..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AppointmentResponse.java +++ /dev/null @@ -1,894 +0,0 @@ - - - - - - - - - - - - - - - - -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.BaseResource; -import ca.uhn.fhir.model.api.IElement; -import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.api.Include; -import ca.uhn.fhir.model.api.TemporalPrecisionEnum; -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.Description; -import ca.uhn.fhir.model.api.annotation.ResourceDef; -import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; -import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.composite.ScheduleDt; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.ParticipantTypeEnum; -import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; -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.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.StringClientParam; - - -/** - * HAPI/FHIR AppointmentResponse Resource - * ((informative) A response to a scheduled appointment for a patient and/or practitioner(s)) - * - *

- * Definition: - * A scheduled appointment for a patient and/or practitioner(s) where a service may take place. - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/AppointmentResponse - *

- * - */ -@ResourceDef(name="AppointmentResponse", profile="http://hl7.org/fhir/profiles/AppointmentResponse", id="appointmentresponse") -public class AppointmentResponse extends BaseResource implements IResource { - - /** - * Search parameter constant for partstatus - *

- * Description: The overall status of the appointment
- * Type: string
- * Path: AppointmentResponse.participantStatus
- *

- */ - @SearchParamDefinition(name="partstatus", path="AppointmentResponse.participantStatus", description="The overall status of the appointment", type="string" ) - public static final String SP_PARTSTATUS = "partstatus"; - - /** - * Fluent Client search parameter constant for partstatus - *

- * Description: The overall status of the appointment
- * Type: string
- * Path: AppointmentResponse.participantStatus
- *

- */ - public static final StringClientParam PARTSTATUS = new StringClientParam(SP_PARTSTATUS); - - /** - * Search parameter constant for subject - *

- * Description: The subject that the appointment response replies for
- * Type: reference
- * Path: AppointmentResponse.individual
- *

- */ - @SearchParamDefinition(name="subject", path="AppointmentResponse.individual", description="The subject that the appointment response replies for", type="reference" ) - public static final String SP_SUBJECT = "subject"; - - /** - * Fluent Client search parameter constant for subject - *

- * Description: The subject that the appointment response replies for
- * Type: reference
- * Path: AppointmentResponse.individual
- *

- */ - public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "AppointmentResponse.individual". - */ - public static final Include INCLUDE_INDIVIDUAL = new Include("AppointmentResponse.individual"); - - /** - * Search parameter constant for appointment - *

- * Description: The appointment that the response is attached to
- * Type: reference
- * Path: AppointmentResponse.appointment
- *

- */ - @SearchParamDefinition(name="appointment", path="AppointmentResponse.appointment", description="The appointment that the response is attached to", type="reference" ) - public static final String SP_APPOINTMENT = "appointment"; - - /** - * Fluent Client search parameter constant for appointment - *

- * Description: The appointment that the response is attached to
- * Type: reference
- * Path: AppointmentResponse.appointment
- *

- */ - public static final ReferenceClientParam APPOINTMENT = new ReferenceClientParam(SP_APPOINTMENT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "AppointmentResponse.appointment". - */ - public static final Include INCLUDE_APPOINTMENT = new Include("AppointmentResponse.appointment"); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="External Ids for this item", - formalDefinition="This records identifiers associated with this appointment concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)" - ) - private java.util.List myIdentifier; - - @Child(name="appointment", order=1, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Appointment.class }) - @Description( - shortDefinition="Parent appointment that this response is replying to", - formalDefinition="" - ) - private ResourceReferenceDt myAppointment; - - @Child(name="participantType", type=CodeableConceptDt.class, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Role of participant in the appointment", - formalDefinition="" - ) - private java.util.List> myParticipantType; - - @Child(name="individual", order=3, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.RelatedPerson.class, ca.uhn.fhir.model.dstu.resource.Device.class }) - @Description( - shortDefinition="A Person of device that is participating in the appointment", - formalDefinition="" - ) - private java.util.List myIndividual; - - @Child(name="participantStatus", type=CodeDt.class, order=4, min=1, max=1) - @Description( - shortDefinition="accepted | declined | tentative | in-process | completed | needs-action", - formalDefinition="Participation status of the Patient" - ) - private CodeDt myParticipantStatus; - - @Child(name="comment", type=StringDt.class, order=5, min=0, max=1) - @Description( - shortDefinition="Additional comments about the appointment", - formalDefinition="" - ) - private StringDt myComment; - - @Child(name="start", type=InstantDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="Date/Time that the appointment is to take place", - formalDefinition="" - ) - private InstantDt myStart; - - @Child(name="end", type=InstantDt.class, order=7, min=0, max=1) - @Description( - shortDefinition="Date/Time that the appointment is to conclude", - formalDefinition="" - ) - private InstantDt myEnd; - - @Child(name="schedule", type=ScheduleDt.class, order=8, min=0, max=1) - @Description( - shortDefinition="The recurrence schedule for the appointment. The end date in the schedule marks the end of the recurrence(s), not the end of an individual appointment", - formalDefinition="" - ) - private ScheduleDt mySchedule; - - @Child(name="timezone", type=StringDt.class, order=9, min=0, max=1) - @Description( - shortDefinition="The timezone that the times are to be converted to. Required for recurring appointments to remain accurate where the schedule makes the appointment cross a daylight saving boundry", - formalDefinition="The timezone should be a value referenced from a timezone database" - ) - private StringDt myTimezone; - - @Child(name="recorder", order=10, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.RelatedPerson.class }) - @Description( - shortDefinition="Who recorded the appointment response", - formalDefinition="" - ) - private ResourceReferenceDt myRecorder; - - @Child(name="recordedDate", type=DateTimeDt.class, order=11, min=0, max=1) - @Description( - shortDefinition="Date when the response was recorded or last updated", - formalDefinition="" - ) - private DateTimeDt myRecordedDate; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myAppointment, myParticipantType, myIndividual, myParticipantStatus, myComment, myStart, myEnd, mySchedule, myTimezone, myRecorder, myRecordedDate); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myAppointment, myParticipantType, myIndividual, myParticipantStatus, myComment, myStart, myEnd, mySchedule, myTimezone, myRecorder, myRecordedDate); - } - - /** - * Gets the value(s) for identifier (External Ids for this item). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * This records identifiers associated with this appointment concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (External Ids for this item) - * - *

- * Definition: - * This records identifiers associated with this appointment concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public AppointmentResponse setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (External Ids for this item) - * - *

- * Definition: - * This records identifiers associated with this appointment concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (External Ids for this item), - * creating it if it does not already exist. - * - *

- * Definition: - * This records identifiers associated with this appointment concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (External Ids for this item) - * - *

- * Definition: - * This records identifiers associated with this appointment concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public AppointmentResponse addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (External Ids for this item) - * - *

- * Definition: - * This records identifiers associated with this appointment concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public AppointmentResponse addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for appointment (Parent appointment that this response is replying to). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt getAppointment() { - if (myAppointment == null) { - myAppointment = new ResourceReferenceDt(); - } - return myAppointment; - } - - /** - * Sets the value(s) for appointment (Parent appointment that this response is replying to) - * - *

- * Definition: - * - *

- */ - public AppointmentResponse setAppointment(ResourceReferenceDt theValue) { - myAppointment = theValue; - return this; - } - - - /** - * Gets the value(s) for participantType (Role of participant in the appointment). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List> getParticipantType() { - if (myParticipantType == null) { - myParticipantType = new java.util.ArrayList>(); - } - return myParticipantType; - } - - /** - * Sets the value(s) for participantType (Role of participant in the appointment) - * - *

- * Definition: - * - *

- */ - public AppointmentResponse setParticipantType(java.util.List> theValue) { - myParticipantType = theValue; - return this; - } - - /** - * Add a value for participantType (Role of participant in the appointment) 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: - * - *

- */ - public BoundCodeableConceptDt addParticipantType(ParticipantTypeEnum theValue) { - BoundCodeableConceptDt retVal = new BoundCodeableConceptDt(ParticipantTypeEnum.VALUESET_BINDER, theValue); - getParticipantType().add(retVal); - return retVal; - } - - /** - * Gets the first repetition for participantType (Role of participant in the appointment), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public BoundCodeableConceptDt getParticipantTypeFirstRep() { - if (getParticipantType().size() == 0) { - addParticipantType(); - } - return getParticipantType().get(0); - } - - /** - * Add a value for participantType (Role of participant in the appointment) - * - *

- * Definition: - * - *

- */ - public BoundCodeableConceptDt addParticipantType() { - BoundCodeableConceptDt retVal = new BoundCodeableConceptDt(ParticipantTypeEnum.VALUESET_BINDER); - getParticipantType().add(retVal); - return retVal; - } - - /** - * Sets the value(s), and clears any existing value(s) for participantType (Role of participant in the appointment) - * - *

- * Definition: - * - *

- */ - public AppointmentResponse setParticipantType(ParticipantTypeEnum theValue) { - getParticipantType().clear(); - addParticipantType(theValue); - return this; - } - - - /** - * Gets the value(s) for individual (A Person of device that is participating in the appointment). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getIndividual() { - if (myIndividual == null) { - myIndividual = new java.util.ArrayList(); - } - return myIndividual; - } - - /** - * Sets the value(s) for individual (A Person of device that is participating in the appointment) - * - *

- * Definition: - * - *

- */ - public AppointmentResponse setIndividual(java.util.List theValue) { - myIndividual = theValue; - return this; - } - - /** - * Adds and returns a new value for individual (A Person of device that is participating in the appointment) - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt addIndividual() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getIndividual().add(newType); - return newType; - } - - /** - * Gets the value(s) for participantStatus (accepted | declined | tentative | in-process | completed | needs-action). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Participation status of the Patient - *

- */ - public CodeDt getParticipantStatus() { - if (myParticipantStatus == null) { - myParticipantStatus = new CodeDt(); - } - return myParticipantStatus; - } - - /** - * Sets the value(s) for participantStatus (accepted | declined | tentative | in-process | completed | needs-action) - * - *

- * Definition: - * Participation status of the Patient - *

- */ - public AppointmentResponse setParticipantStatus(CodeDt theValue) { - myParticipantStatus = theValue; - return this; - } - - /** - * Sets the value for participantStatus (accepted | declined | tentative | in-process | completed | needs-action) - * - *

- * Definition: - * Participation status of the Patient - *

- */ - public AppointmentResponse setParticipantStatus( String theCode) { - myParticipantStatus = new CodeDt(theCode); - return this; - } - - - /** - * Gets the value(s) for comment (Additional comments about the appointment). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public StringDt getComment() { - if (myComment == null) { - myComment = new StringDt(); - } - return myComment; - } - - /** - * Sets the value(s) for comment (Additional comments about the appointment) - * - *

- * Definition: - * - *

- */ - public AppointmentResponse setComment(StringDt theValue) { - myComment = theValue; - return this; - } - - /** - * Sets the value for comment (Additional comments about the appointment) - * - *

- * Definition: - * - *

- */ - public AppointmentResponse setComment( String theString) { - myComment = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for start (Date/Time that the appointment is to take place). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public InstantDt getStart() { - if (myStart == null) { - myStart = new InstantDt(); - } - return myStart; - } - - /** - * Sets the value(s) for start (Date/Time that the appointment is to take place) - * - *

- * Definition: - * - *

- */ - public AppointmentResponse setStart(InstantDt theValue) { - myStart = theValue; - return this; - } - - /** - * Sets the value for start (Date/Time that the appointment is to take place) - * - *

- * Definition: - * - *

- */ - public AppointmentResponse setStart( Date theDate, TemporalPrecisionEnum thePrecision) { - myStart = new InstantDt(theDate, thePrecision); - return this; - } - - /** - * Sets the value for start (Date/Time that the appointment is to take place) - * - *

- * Definition: - * - *

- */ - public AppointmentResponse setStartWithMillisPrecision( Date theDate) { - myStart = new InstantDt(theDate); - return this; - } - - - /** - * Gets the value(s) for end (Date/Time that the appointment is to conclude). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public InstantDt getEnd() { - if (myEnd == null) { - myEnd = new InstantDt(); - } - return myEnd; - } - - /** - * Sets the value(s) for end (Date/Time that the appointment is to conclude) - * - *

- * Definition: - * - *

- */ - public AppointmentResponse setEnd(InstantDt theValue) { - myEnd = theValue; - return this; - } - - /** - * Sets the value for end (Date/Time that the appointment is to conclude) - * - *

- * Definition: - * - *

- */ - public AppointmentResponse setEnd( Date theDate, TemporalPrecisionEnum thePrecision) { - myEnd = new InstantDt(theDate, thePrecision); - return this; - } - - /** - * Sets the value for end (Date/Time that the appointment is to conclude) - * - *

- * Definition: - * - *

- */ - public AppointmentResponse setEndWithMillisPrecision( Date theDate) { - myEnd = new InstantDt(theDate); - return this; - } - - - /** - * Gets the value(s) for schedule (The recurrence schedule for the appointment. The end date in the schedule marks the end of the recurrence(s), not the end of an individual appointment). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ScheduleDt getSchedule() { - if (mySchedule == null) { - mySchedule = new ScheduleDt(); - } - return mySchedule; - } - - /** - * Sets the value(s) for schedule (The recurrence schedule for the appointment. The end date in the schedule marks the end of the recurrence(s), not the end of an individual appointment) - * - *

- * Definition: - * - *

- */ - public AppointmentResponse setSchedule(ScheduleDt theValue) { - mySchedule = theValue; - return this; - } - - - /** - * Gets the value(s) for timezone (The timezone that the times are to be converted to. Required for recurring appointments to remain accurate where the schedule makes the appointment cross a daylight saving boundry). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The timezone should be a value referenced from a timezone database - *

- */ - public StringDt getTimezone() { - if (myTimezone == null) { - myTimezone = new StringDt(); - } - return myTimezone; - } - - /** - * Sets the value(s) for timezone (The timezone that the times are to be converted to. Required for recurring appointments to remain accurate where the schedule makes the appointment cross a daylight saving boundry) - * - *

- * Definition: - * The timezone should be a value referenced from a timezone database - *

- */ - public AppointmentResponse setTimezone(StringDt theValue) { - myTimezone = theValue; - return this; - } - - /** - * Sets the value for timezone (The timezone that the times are to be converted to. Required for recurring appointments to remain accurate where the schedule makes the appointment cross a daylight saving boundry) - * - *

- * Definition: - * The timezone should be a value referenced from a timezone database - *

- */ - public AppointmentResponse setTimezone( String theString) { - myTimezone = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for recorder (Who recorded the appointment response). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt getRecorder() { - if (myRecorder == null) { - myRecorder = new ResourceReferenceDt(); - } - return myRecorder; - } - - /** - * Sets the value(s) for recorder (Who recorded the appointment response) - * - *

- * Definition: - * - *

- */ - public AppointmentResponse setRecorder(ResourceReferenceDt theValue) { - myRecorder = theValue; - return this; - } - - - /** - * Gets the value(s) for recordedDate (Date when the response was recorded or last updated). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public DateTimeDt getRecordedDate() { - if (myRecordedDate == null) { - myRecordedDate = new DateTimeDt(); - } - return myRecordedDate; - } - - /** - * Sets the value(s) for recordedDate (Date when the response was recorded or last updated) - * - *

- * Definition: - * - *

- */ - public AppointmentResponse setRecordedDate(DateTimeDt theValue) { - myRecordedDate = theValue; - return this; - } - - /** - * Sets the value for recordedDate (Date when the response was recorded or last updated) - * - *

- * Definition: - * - *

- */ - public AppointmentResponse setRecordedDateWithSecondsPrecision( Date theDate) { - myRecordedDate = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for recordedDate (Date when the response was recorded or last updated) - * - *

- * Definition: - * - *

- */ - public AppointmentResponse setRecordedDate( Date theDate, TemporalPrecisionEnum thePrecision) { - myRecordedDate = new DateTimeDt(theDate, thePrecision); - return this; - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Availability.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Availability.java deleted file mode 100644 index 5ec3dc3b750..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Availability.java +++ /dev/null @@ -1,520 +0,0 @@ - - - - - - - - - - - - - - - - -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.BaseResource; -import ca.uhn.fhir.model.api.IElement; -import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.api.Include; -import ca.uhn.fhir.model.api.TemporalPrecisionEnum; -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.Description; -import ca.uhn.fhir.model.api.annotation.ResourceDef; -import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; -import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR Availability Resource - * ((informative) A container for slot(s) of time that may be available for booking appointments) - * - *

- * Definition: - * - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Availability - *

- * - */ -@ResourceDef(name="Availability", profile="http://hl7.org/fhir/profiles/Availability", id="availability") -public class Availability extends BaseResource implements IResource { - - /** - * Search parameter constant for individual - *

- * Description: The individual to find an availability for
- * Type: reference
- * Path: Availability.individual
- *

- */ - @SearchParamDefinition(name="individual", path="Availability.individual", description="The individual to find an availability for", type="reference" ) - public static final String SP_INDIVIDUAL = "individual"; - - /** - * Fluent Client search parameter constant for individual - *

- * Description: The individual to find an availability for
- * Type: reference
- * Path: Availability.individual
- *

- */ - public static final ReferenceClientParam INDIVIDUAL = new ReferenceClientParam(SP_INDIVIDUAL); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Availability.individual". - */ - public static final Include INCLUDE_INDIVIDUAL = new Include("Availability.individual"); - - /** - * Search parameter constant for slottype - *

- * Description: The type of appointments that can be booked into associated slot(s)
- * Type: token
- * Path: Availability.type
- *

- */ - @SearchParamDefinition(name="slottype", path="Availability.type", description="The type of appointments that can be booked into associated slot(s)", type="token" ) - public static final String SP_SLOTTYPE = "slottype"; - - /** - * Fluent Client search parameter constant for slottype - *

- * Description: The type of appointments that can be booked into associated slot(s)
- * Type: token
- * Path: Availability.type
- *

- */ - public static final TokenClientParam SLOTTYPE = new TokenClientParam(SP_SLOTTYPE); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="External Ids for this item", - formalDefinition="" - ) - private java.util.List myIdentifier; - - @Child(name="type", type=CodeableConceptDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="The type of appointments that can be booked into slots attached to this availability resource (ideally this would be an identifiable service - which is at a location, rather than the location itself) - change to CodeableConcept", - formalDefinition="" - ) - private CodeableConceptDt myType; - - @Child(name="individual", order=2, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Location.class, ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Device.class, ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.RelatedPerson.class }) - @Description( - shortDefinition="The type of resource this availability resource is providing availability information for", - formalDefinition="" - ) - private ResourceReferenceDt myIndividual; - - @Child(name="period", type=PeriodDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="The period of time that the slots that are attached to this availability resource cover (even if none exist)", - formalDefinition="" - ) - private PeriodDt myPeriod; - - @Child(name="comment", type=StringDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated", - formalDefinition="" - ) - private StringDt myComment; - - @Child(name="author", order=5, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.RelatedPerson.class }) - @Description( - shortDefinition="Who authored the availability", - formalDefinition="" - ) - private ResourceReferenceDt myAuthor; - - @Child(name="authorDate", type=DateTimeDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="When this availability was created, or last revised", - formalDefinition="" - ) - private DateTimeDt myAuthorDate; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myType, myIndividual, myPeriod, myComment, myAuthor, myAuthorDate); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myType, myIndividual, myPeriod, myComment, myAuthor, myAuthorDate); - } - - /** - * Gets the value(s) for identifier (External Ids for this item). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (External Ids for this item) - * - *

- * Definition: - * - *

- */ - public Availability setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (External Ids for this item) - * - *

- * Definition: - * - *

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (External Ids for this item), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (External Ids for this item) - * - *

- * Definition: - * - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Availability addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (External Ids for this item) - * - *

- * Definition: - * - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Availability addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for type (The type of appointments that can be booked into slots attached to this availability resource (ideally this would be an identifiable service - which is at a location, rather than the location itself) - change to CodeableConcept). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public CodeableConceptDt getType() { - if (myType == null) { - myType = new CodeableConceptDt(); - } - return myType; - } - - /** - * Sets the value(s) for type (The type of appointments that can be booked into slots attached to this availability resource (ideally this would be an identifiable service - which is at a location, rather than the location itself) - change to CodeableConcept) - * - *

- * Definition: - * - *

- */ - public Availability setType(CodeableConceptDt theValue) { - myType = theValue; - return this; - } - - - /** - * Gets the value(s) for individual (The type of resource this availability resource is providing availability information for). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt getIndividual() { - if (myIndividual == null) { - myIndividual = new ResourceReferenceDt(); - } - return myIndividual; - } - - /** - * Sets the value(s) for individual (The type of resource this availability resource is providing availability information for) - * - *

- * Definition: - * - *

- */ - public Availability setIndividual(ResourceReferenceDt theValue) { - myIndividual = theValue; - return this; - } - - - /** - * Gets the value(s) for period (The period of time that the slots that are attached to this availability resource cover (even if none exist)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public PeriodDt getPeriod() { - if (myPeriod == null) { - myPeriod = new PeriodDt(); - } - return myPeriod; - } - - /** - * Sets the value(s) for period (The period of time that the slots that are attached to this availability resource cover (even if none exist)) - * - *

- * Definition: - * - *

- */ - public Availability setPeriod(PeriodDt theValue) { - myPeriod = theValue; - return this; - } - - - /** - * Gets the value(s) for comment (Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public StringDt getComment() { - if (myComment == null) { - myComment = new StringDt(); - } - return myComment; - } - - /** - * Sets the value(s) for comment (Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated) - * - *

- * Definition: - * - *

- */ - public Availability setComment(StringDt theValue) { - myComment = theValue; - return this; - } - - /** - * Sets the value for comment (Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated) - * - *

- * Definition: - * - *

- */ - public Availability setComment( String theString) { - myComment = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for author (Who authored the availability). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt getAuthor() { - if (myAuthor == null) { - myAuthor = new ResourceReferenceDt(); - } - return myAuthor; - } - - /** - * Sets the value(s) for author (Who authored the availability) - * - *

- * Definition: - * - *

- */ - public Availability setAuthor(ResourceReferenceDt theValue) { - myAuthor = theValue; - return this; - } - - - /** - * Gets the value(s) for authorDate (When this availability was created, or last revised). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public DateTimeDt getAuthorDate() { - if (myAuthorDate == null) { - myAuthorDate = new DateTimeDt(); - } - return myAuthorDate; - } - - /** - * Sets the value(s) for authorDate (When this availability was created, or last revised) - * - *

- * Definition: - * - *

- */ - public Availability setAuthorDate(DateTimeDt theValue) { - myAuthorDate = theValue; - return this; - } - - /** - * Sets the value for authorDate (When this availability was created, or last revised) - * - *

- * Definition: - * - *

- */ - public Availability setAuthorDateWithSecondsPrecision( Date theDate) { - myAuthorDate = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for authorDate (When this availability was created, or last revised) - * - *

- * Definition: - * - *

- */ - public Availability setAuthorDate( Date theDate, TemporalPrecisionEnum thePrecision) { - myAuthorDate = new DateTimeDt(theDate, thePrecision); - return this; - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/CarePlan.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/CarePlan.java deleted file mode 100644 index 267dbaff32f..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/CarePlan.java +++ /dev/null @@ -1,2159 +0,0 @@ - - - - - - - - - - - - - - - - -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.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.composite.ScheduleDt; -import ca.uhn.fhir.model.dstu.valueset.CarePlanActivityCategoryEnum; -import ca.uhn.fhir.model.dstu.valueset.CarePlanActivityStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.CarePlanGoalStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.CarePlanStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; -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.IdrefDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.rest.gclient.DateClientParam; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR CarePlan Resource - * (Healthcare plan for patient) - * - *

- * Definition: - * Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions. - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/CarePlan - *

- * - */ -@ResourceDef(name="CarePlan", profile="http://hl7.org/fhir/profiles/CarePlan", id="careplan") -public class CarePlan extends BaseResource implements IResource { - - /** - * Search parameter constant for patient - *

- * Description:
- * Type: reference
- * Path: CarePlan.patient
- *

- */ - @SearchParamDefinition(name="patient", path="CarePlan.patient", description="", type="reference" ) - public static final String SP_PATIENT = "patient"; - - /** - * Fluent Client search parameter constant for patient - *

- * Description:
- * Type: reference
- * Path: CarePlan.patient
- *

- */ - public static final ReferenceClientParam PATIENT = new ReferenceClientParam(SP_PATIENT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "CarePlan.patient". - */ - public static final Include INCLUDE_PATIENT = new Include("CarePlan.patient"); - - /** - * Search parameter constant for condition - *

- * Description:
- * Type: reference
- * Path: CarePlan.concern
- *

- */ - @SearchParamDefinition(name="condition", path="CarePlan.concern", description="", type="reference" ) - public static final String SP_CONDITION = "condition"; - - /** - * Fluent Client search parameter constant for condition - *

- * Description:
- * Type: reference
- * Path: CarePlan.concern
- *

- */ - public static final ReferenceClientParam CONDITION = new ReferenceClientParam(SP_CONDITION); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "CarePlan.concern". - */ - public static final Include INCLUDE_CONCERN = new Include("CarePlan.concern"); - - /** - * Search parameter constant for date - *

- * Description:
- * Type: date
- * Path: CarePlan.period
- *

- */ - @SearchParamDefinition(name="date", path="CarePlan.period", description="", type="date" ) - public static final String SP_DATE = "date"; - - /** - * Fluent Client search parameter constant for date - *

- * Description:
- * Type: date
- * Path: CarePlan.period
- *

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

- * Description:
- * Type: reference
- * Path: CarePlan.participant.member
- *

- */ - @SearchParamDefinition(name="participant", path="CarePlan.participant.member", description="", type="reference" ) - public static final String SP_PARTICIPANT = "participant"; - - /** - * Fluent Client search parameter constant for participant - *

- * Description:
- * Type: reference
- * Path: CarePlan.participant.member
- *

- */ - public static final ReferenceClientParam PARTICIPANT = new ReferenceClientParam(SP_PARTICIPANT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "CarePlan.participant.member". - */ - public static final Include INCLUDE_PARTICIPANT_MEMBER = new Include("CarePlan.participant.member"); - - /** - * Search parameter constant for activitycode - *

- * Description:
- * Type: token
- * Path: CarePlan.activity.simple.code
- *

- */ - @SearchParamDefinition(name="activitycode", path="CarePlan.activity.simple.code", description="", type="token" ) - public static final String SP_ACTIVITYCODE = "activitycode"; - - /** - * Fluent Client search parameter constant for activitycode - *

- * Description:
- * Type: token
- * Path: CarePlan.activity.simple.code
- *

- */ - public static final TokenClientParam ACTIVITYCODE = new TokenClientParam(SP_ACTIVITYCODE); - - /** - * Search parameter constant for activitydate - *

- * Description: Specified date occurs within period specified by CarePlan.activity.timingSchedule
- * Type: date
- * Path: CarePlan.activity.simple.timing[x]
- *

- */ - @SearchParamDefinition(name="activitydate", path="CarePlan.activity.simple.timing[x]", description="Specified date occurs within period specified by CarePlan.activity.timingSchedule", type="date" ) - public static final String SP_ACTIVITYDATE = "activitydate"; - - /** - * Fluent Client search parameter constant for activitydate - *

- * Description: Specified date occurs within period specified by CarePlan.activity.timingSchedule
- * Type: date
- * Path: CarePlan.activity.simple.timing[x]
- *

- */ - public static final DateClientParam ACTIVITYDATE = new DateClientParam(SP_ACTIVITYDATE); - - /** - * Search parameter constant for activitydetail - *

- * Description:
- * Type: reference
- * Path: CarePlan.activity.detail
- *

- */ - @SearchParamDefinition(name="activitydetail", path="CarePlan.activity.detail", description="", type="reference" ) - public static final String SP_ACTIVITYDETAIL = "activitydetail"; - - /** - * Fluent Client search parameter constant for activitydetail - *

- * Description:
- * Type: reference
- * Path: CarePlan.activity.detail
- *

- */ - public static final ReferenceClientParam ACTIVITYDETAIL = new ReferenceClientParam(SP_ACTIVITYDETAIL); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "CarePlan.activity.detail". - */ - public static final Include INCLUDE_ACTIVITY_DETAIL = new Include("CarePlan.activity.detail"); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="External Ids for this plan", - formalDefinition="This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)" - ) - private java.util.List myIdentifier; - - @Child(name="patient", order=1, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="Who care plan is for", - formalDefinition="Identifies the patient/subject whose intended care is described by the plan." - ) - private ResourceReferenceDt myPatient; - - @Child(name="status", type=CodeDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="planned | active | completed", - formalDefinition="Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record." - ) - private BoundCodeDt myStatus; - - @Child(name="period", type=PeriodDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Time period plan covers", - formalDefinition="Indicates when the plan did (or is intended to) come into effect and end." - ) - private PeriodDt myPeriod; - - @Child(name="modified", type=DateTimeDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="When last updated", - formalDefinition="Identifies the most recent date on which the plan has been revised." - ) - private DateTimeDt myModified; - - @Child(name="concern", order=5, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Condition.class }) - @Description( - shortDefinition="Health issues this plan addresses", - formalDefinition="Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan." - ) - private java.util.List myConcern; - - @Child(name="participant", order=6, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Who's involved in plan?", - formalDefinition="Identifies all people and organizations who are expected to be involved in the care envisioned by this plan." - ) - private java.util.List myParticipant; - - @Child(name="goal", order=7, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Desired outcome of plan", - formalDefinition="Describes the intended objective(s) of carrying out the Care Plan." - ) - private java.util.List myGoal; - - @Child(name="activity", order=8, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Action to occur as part of plan", - formalDefinition="Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc." - ) - private java.util.List myActivity; - - @Child(name="notes", type=StringDt.class, order=9, min=0, max=1) - @Description( - shortDefinition="Comments about the plan", - formalDefinition="General notes about the care plan not covered elsewhere" - ) - private StringDt myNotes; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myPatient, myStatus, myPeriod, myModified, myConcern, myParticipant, myGoal, myActivity, myNotes); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myPatient, myStatus, myPeriod, myModified, myConcern, myParticipant, myGoal, myActivity, myNotes); - } - - /** - * Gets the value(s) for identifier (External Ids for this plan). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (External Ids for this plan) - * - *

- * Definition: - * This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public CarePlan setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (External Ids for this plan) - * - *

- * Definition: - * This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (External Ids for this plan), - * creating it if it does not already exist. - * - *

- * Definition: - * This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (External Ids for this plan) - * - *

- * Definition: - * This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public CarePlan addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (External Ids for this plan) - * - *

- * Definition: - * This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public CarePlan addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for patient (Who care plan is for). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the patient/subject whose intended care is described by the plan. - *

- */ - public ResourceReferenceDt getPatient() { - if (myPatient == null) { - myPatient = new ResourceReferenceDt(); - } - return myPatient; - } - - /** - * Sets the value(s) for patient (Who care plan is for) - * - *

- * Definition: - * Identifies the patient/subject whose intended care is described by the plan. - *

- */ - public CarePlan setPatient(ResourceReferenceDt theValue) { - myPatient = theValue; - return this; - } - - - /** - * Gets the value(s) for status (planned | active | completed). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record. - *

- */ - public BoundCodeDt getStatus() { - if (myStatus == null) { - myStatus = new BoundCodeDt(CarePlanStatusEnum.VALUESET_BINDER); - } - return myStatus; - } - - /** - * Sets the value(s) for status (planned | active | completed) - * - *

- * Definition: - * Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record. - *

- */ - public CarePlan setStatus(BoundCodeDt theValue) { - myStatus = theValue; - return this; - } - - /** - * Sets the value(s) for status (planned | active | completed) - * - *

- * Definition: - * Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record. - *

- */ - public CarePlan setStatus(CarePlanStatusEnum theValue) { - getStatus().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for period (Time period plan covers). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates when the plan did (or is intended to) come into effect and end. - *

- */ - public PeriodDt getPeriod() { - if (myPeriod == null) { - myPeriod = new PeriodDt(); - } - return myPeriod; - } - - /** - * Sets the value(s) for period (Time period plan covers) - * - *

- * Definition: - * Indicates when the plan did (or is intended to) come into effect and end. - *

- */ - public CarePlan setPeriod(PeriodDt theValue) { - myPeriod = theValue; - return this; - } - - - /** - * Gets the value(s) for modified (When last updated). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the most recent date on which the plan has been revised. - *

- */ - public DateTimeDt getModified() { - if (myModified == null) { - myModified = new DateTimeDt(); - } - return myModified; - } - - /** - * Sets the value(s) for modified (When last updated) - * - *

- * Definition: - * Identifies the most recent date on which the plan has been revised. - *

- */ - public CarePlan setModified(DateTimeDt theValue) { - myModified = theValue; - return this; - } - - /** - * Sets the value for modified (When last updated) - * - *

- * Definition: - * Identifies the most recent date on which the plan has been revised. - *

- */ - public CarePlan setModifiedWithSecondsPrecision( Date theDate) { - myModified = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for modified (When last updated) - * - *

- * Definition: - * Identifies the most recent date on which the plan has been revised. - *

- */ - public CarePlan setModified( Date theDate, TemporalPrecisionEnum thePrecision) { - myModified = new DateTimeDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for concern (Health issues this plan addresses). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan. - *

- */ - public java.util.List getConcern() { - if (myConcern == null) { - myConcern = new java.util.ArrayList(); - } - return myConcern; - } - - /** - * Sets the value(s) for concern (Health issues this plan addresses) - * - *

- * Definition: - * Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan. - *

- */ - public CarePlan setConcern(java.util.List theValue) { - myConcern = theValue; - return this; - } - - /** - * Adds and returns a new value for concern (Health issues this plan addresses) - * - *

- * Definition: - * Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan. - *

- */ - public ResourceReferenceDt addConcern() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getConcern().add(newType); - return newType; - } - - /** - * Gets the value(s) for participant (Who's involved in plan?). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies all people and organizations who are expected to be involved in the care envisioned by this plan. - *

- */ - public java.util.List getParticipant() { - if (myParticipant == null) { - myParticipant = new java.util.ArrayList(); - } - return myParticipant; - } - - /** - * Sets the value(s) for participant (Who's involved in plan?) - * - *

- * Definition: - * Identifies all people and organizations who are expected to be involved in the care envisioned by this plan. - *

- */ - public CarePlan setParticipant(java.util.List theValue) { - myParticipant = theValue; - return this; - } - - /** - * Adds and returns a new value for participant (Who's involved in plan?) - * - *

- * Definition: - * Identifies all people and organizations who are expected to be involved in the care envisioned by this plan. - *

- */ - public Participant addParticipant() { - Participant newType = new Participant(); - getParticipant().add(newType); - return newType; - } - - /** - * Gets the first repetition for participant (Who's involved in plan?), - * creating it if it does not already exist. - * - *

- * Definition: - * Identifies all people and organizations who are expected to be involved in the care envisioned by this plan. - *

- */ - public Participant getParticipantFirstRep() { - if (getParticipant().isEmpty()) { - return addParticipant(); - } - return getParticipant().get(0); - } - - /** - * Gets the value(s) for goal (Desired outcome of plan). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Describes the intended objective(s) of carrying out the Care Plan. - *

- */ - public java.util.List getGoal() { - if (myGoal == null) { - myGoal = new java.util.ArrayList(); - } - return myGoal; - } - - /** - * Sets the value(s) for goal (Desired outcome of plan) - * - *

- * Definition: - * Describes the intended objective(s) of carrying out the Care Plan. - *

- */ - public CarePlan setGoal(java.util.List theValue) { - myGoal = theValue; - return this; - } - - /** - * Adds and returns a new value for goal (Desired outcome of plan) - * - *

- * Definition: - * Describes the intended objective(s) of carrying out the Care Plan. - *

- */ - public Goal addGoal() { - Goal newType = new Goal(); - getGoal().add(newType); - return newType; - } - - /** - * Gets the first repetition for goal (Desired outcome of plan), - * creating it if it does not already exist. - * - *

- * Definition: - * Describes the intended objective(s) of carrying out the Care Plan. - *

- */ - public Goal getGoalFirstRep() { - if (getGoal().isEmpty()) { - return addGoal(); - } - return getGoal().get(0); - } - - /** - * Gets the value(s) for activity (Action to occur as part of plan). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc. - *

- */ - public java.util.List getActivity() { - if (myActivity == null) { - myActivity = new java.util.ArrayList(); - } - return myActivity; - } - - /** - * Sets the value(s) for activity (Action to occur as part of plan) - * - *

- * Definition: - * Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc. - *

- */ - public CarePlan setActivity(java.util.List theValue) { - myActivity = theValue; - return this; - } - - /** - * Adds and returns a new value for activity (Action to occur as part of plan) - * - *

- * Definition: - * Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc. - *

- */ - public Activity addActivity() { - Activity newType = new Activity(); - getActivity().add(newType); - return newType; - } - - /** - * Gets the first repetition for activity (Action to occur as part of plan), - * creating it if it does not already exist. - * - *

- * Definition: - * Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc. - *

- */ - public Activity getActivityFirstRep() { - if (getActivity().isEmpty()) { - return addActivity(); - } - return getActivity().get(0); - } - - /** - * Gets the value(s) for notes (Comments about the plan). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * General notes about the care plan not covered elsewhere - *

- */ - public StringDt getNotes() { - if (myNotes == null) { - myNotes = new StringDt(); - } - return myNotes; - } - - /** - * Sets the value(s) for notes (Comments about the plan) - * - *

- * Definition: - * General notes about the care plan not covered elsewhere - *

- */ - public CarePlan setNotes(StringDt theValue) { - myNotes = theValue; - return this; - } - - /** - * Sets the value for notes (Comments about the plan) - * - *

- * Definition: - * General notes about the care plan not covered elsewhere - *

- */ - public CarePlan setNotes( String theString) { - myNotes = new StringDt(theString); - return this; - } - - - /** - * Block class for child element: CarePlan.participant (Who's involved in plan?) - * - *

- * Definition: - * Identifies all people and organizations who are expected to be involved in the care envisioned by this plan. - *

- */ - @Block() - public static class Participant extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="role", type=CodeableConceptDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Type of involvement", - formalDefinition="Indicates specific responsibility of an individual within the care plan. E.g. \"Primary physician\", \"Team coordinator\", \"Caregiver\", etc." - ) - private CodeableConceptDt myRole; - - @Child(name="member", order=1, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.RelatedPerson.class, ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.Organization.class }) - @Description( - shortDefinition="Who is involved", - formalDefinition="The specific person or organization who is participating/expected to participate in the care plan." - ) - private ResourceReferenceDt myMember; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myRole, myMember); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myRole, myMember); - } - - /** - * Gets the value(s) for role (Type of involvement). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates specific responsibility of an individual within the care plan. E.g. \"Primary physician\", \"Team coordinator\", \"Caregiver\", etc. - *

- */ - public CodeableConceptDt getRole() { - if (myRole == null) { - myRole = new CodeableConceptDt(); - } - return myRole; - } - - /** - * Sets the value(s) for role (Type of involvement) - * - *

- * Definition: - * Indicates specific responsibility of an individual within the care plan. E.g. \"Primary physician\", \"Team coordinator\", \"Caregiver\", etc. - *

- */ - public Participant setRole(CodeableConceptDt theValue) { - myRole = theValue; - return this; - } - - - /** - * Gets the value(s) for member (Who is involved). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The specific person or organization who is participating/expected to participate in the care plan. - *

- */ - public ResourceReferenceDt getMember() { - if (myMember == null) { - myMember = new ResourceReferenceDt(); - } - return myMember; - } - - /** - * Sets the value(s) for member (Who is involved) - * - *

- * Definition: - * The specific person or organization who is participating/expected to participate in the care plan. - *

- */ - public Participant setMember(ResourceReferenceDt theValue) { - myMember = theValue; - return this; - } - - - - } - - - /** - * Block class for child element: CarePlan.goal (Desired outcome of plan) - * - *

- * Definition: - * Describes the intended objective(s) of carrying out the Care Plan. - *

- */ - @Block() - public static class Goal extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="description", type=StringDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="What's the desired outcome?", - formalDefinition="Human-readable description of a specific desired objective of the care plan." - ) - private StringDt myDescription; - - @Child(name="status", type=CodeDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="in progress | achieved | sustaining | cancelled", - formalDefinition="Indicates whether the goal has been reached and is still considered relevant" - ) - private BoundCodeDt myStatus; - - @Child(name="notes", type=StringDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Comments about the goal", - formalDefinition="Any comments related to the goal" - ) - private StringDt myNotes; - - @Child(name="concern", order=3, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Condition.class }) - @Description( - shortDefinition="Health issues this goal addresses", - formalDefinition="The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address" - ) - private java.util.List myConcern; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myDescription, myStatus, myNotes, myConcern); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myDescription, myStatus, myNotes, myConcern); - } - - /** - * Gets the value(s) for description (What's the desired outcome?). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Human-readable description of a specific desired objective of the care plan. - *

- */ - public StringDt getDescription() { - if (myDescription == null) { - myDescription = new StringDt(); - } - return myDescription; - } - - /** - * Sets the value(s) for description (What's the desired outcome?) - * - *

- * Definition: - * Human-readable description of a specific desired objective of the care plan. - *

- */ - public Goal setDescription(StringDt theValue) { - myDescription = theValue; - return this; - } - - /** - * Sets the value for description (What's the desired outcome?) - * - *

- * Definition: - * Human-readable description of a specific desired objective of the care plan. - *

- */ - public Goal setDescription( String theString) { - myDescription = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for status (in progress | achieved | sustaining | cancelled). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates whether the goal has been reached and is still considered relevant - *

- */ - public BoundCodeDt getStatus() { - if (myStatus == null) { - myStatus = new BoundCodeDt(CarePlanGoalStatusEnum.VALUESET_BINDER); - } - return myStatus; - } - - /** - * Sets the value(s) for status (in progress | achieved | sustaining | cancelled) - * - *

- * Definition: - * Indicates whether the goal has been reached and is still considered relevant - *

- */ - public Goal setStatus(BoundCodeDt theValue) { - myStatus = theValue; - return this; - } - - /** - * Sets the value(s) for status (in progress | achieved | sustaining | cancelled) - * - *

- * Definition: - * Indicates whether the goal has been reached and is still considered relevant - *

- */ - public Goal setStatus(CarePlanGoalStatusEnum theValue) { - getStatus().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for notes (Comments about the goal). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Any comments related to the goal - *

- */ - public StringDt getNotes() { - if (myNotes == null) { - myNotes = new StringDt(); - } - return myNotes; - } - - /** - * Sets the value(s) for notes (Comments about the goal) - * - *

- * Definition: - * Any comments related to the goal - *

- */ - public Goal setNotes(StringDt theValue) { - myNotes = theValue; - return this; - } - - /** - * Sets the value for notes (Comments about the goal) - * - *

- * Definition: - * Any comments related to the goal - *

- */ - public Goal setNotes( String theString) { - myNotes = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for concern (Health issues this goal addresses). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address - *

- */ - public java.util.List getConcern() { - if (myConcern == null) { - myConcern = new java.util.ArrayList(); - } - return myConcern; - } - - /** - * Sets the value(s) for concern (Health issues this goal addresses) - * - *

- * Definition: - * The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address - *

- */ - public Goal setConcern(java.util.List theValue) { - myConcern = theValue; - return this; - } - - /** - * Adds and returns a new value for concern (Health issues this goal addresses) - * - *

- * Definition: - * The identified conditions that this goal relates to - the condition that caused it to be created, or that it is intended to address - *

- */ - public ResourceReferenceDt addConcern() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getConcern().add(newType); - return newType; - } - - - } - - - /** - * Block class for child element: CarePlan.activity (Action to occur as part of plan) - * - *

- * Definition: - * Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc. - *

- */ - @Block() - public static class Activity extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="goal", type=IdrefDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Goals this activity relates to", - formalDefinition="Internal reference that identifies the goals that this activity is intended to contribute towards meeting" - ) - private java.util.List myGoal; - - @Child(name="status", type=CodeDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="not started | scheduled | in progress | on hold | completed | cancelled", - formalDefinition="Identifies what progress is being made for the specific activity." - ) - private BoundCodeDt myStatus; - - @Child(name="prohibited", type=BooleanDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="Do NOT do", - formalDefinition="If true, indicates that the described activity is one that must NOT be engaged in when following the plan." - ) - private BooleanDt myProhibited; - - @Child(name="actionResulting", order=3, min=0, max=Child.MAX_UNLIMITED, type={ - IResource.class }) - @Description( - shortDefinition="Appointments, orders, etc.", - formalDefinition="Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc." - ) - private java.util.List myActionResulting; - - @Child(name="notes", type=StringDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="Comments about the activity", - formalDefinition="Notes about the execution of the activity" - ) - private StringDt myNotes; - - @Child(name="detail", order=5, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Procedure.class, ca.uhn.fhir.model.dstu.resource.MedicationPrescription.class, ca.uhn.fhir.model.dstu.resource.DiagnosticOrder.class, ca.uhn.fhir.model.dstu.resource.Encounter.class }) - @Description( - shortDefinition="Activity details defined in specific resource", - formalDefinition="The details of the proposed activity represented in a specific resource" - ) - private ResourceReferenceDt myDetail; - - @Child(name="simple", order=6, min=0, max=1) - @Description( - shortDefinition="Activity details summarised here", - formalDefinition="A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc" - ) - private ActivitySimple mySimple; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myGoal, myStatus, myProhibited, myActionResulting, myNotes, myDetail, mySimple); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myGoal, myStatus, myProhibited, myActionResulting, myNotes, myDetail, mySimple); - } - - /** - * Gets the value(s) for goal (Goals this activity relates to). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Internal reference that identifies the goals that this activity is intended to contribute towards meeting - *

- */ - public java.util.List getGoal() { - if (myGoal == null) { - myGoal = new java.util.ArrayList(); - } - return myGoal; - } - - /** - * Sets the value(s) for goal (Goals this activity relates to) - * - *

- * Definition: - * Internal reference that identifies the goals that this activity is intended to contribute towards meeting - *

- */ - public Activity setGoal(java.util.List theValue) { - myGoal = theValue; - return this; - } - - /** - * Adds and returns a new value for goal (Goals this activity relates to) - * - *

- * Definition: - * Internal reference that identifies the goals that this activity is intended to contribute towards meeting - *

- */ - public IdrefDt addGoal() { - IdrefDt newType = new IdrefDt(); - getGoal().add(newType); - return newType; - } - - /** - * Gets the first repetition for goal (Goals this activity relates to), - * creating it if it does not already exist. - * - *

- * Definition: - * Internal reference that identifies the goals that this activity is intended to contribute towards meeting - *

- */ - public IdrefDt getGoalFirstRep() { - if (getGoal().isEmpty()) { - return addGoal(); - } - return getGoal().get(0); - } - - /** - * Gets the value(s) for status (not started | scheduled | in progress | on hold | completed | cancelled). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies what progress is being made for the specific activity. - *

- */ - public BoundCodeDt getStatus() { - if (myStatus == null) { - myStatus = new BoundCodeDt(CarePlanActivityStatusEnum.VALUESET_BINDER); - } - return myStatus; - } - - /** - * Sets the value(s) for status (not started | scheduled | in progress | on hold | completed | cancelled) - * - *

- * Definition: - * Identifies what progress is being made for the specific activity. - *

- */ - public Activity setStatus(BoundCodeDt theValue) { - myStatus = theValue; - return this; - } - - /** - * Sets the value(s) for status (not started | scheduled | in progress | on hold | completed | cancelled) - * - *

- * Definition: - * Identifies what progress is being made for the specific activity. - *

- */ - public Activity setStatus(CarePlanActivityStatusEnum theValue) { - getStatus().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for prohibited (Do NOT do). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * If true, indicates that the described activity is one that must NOT be engaged in when following the plan. - *

- */ - public BooleanDt getProhibited() { - if (myProhibited == null) { - myProhibited = new BooleanDt(); - } - return myProhibited; - } - - /** - * Sets the value(s) for prohibited (Do NOT do) - * - *

- * Definition: - * If true, indicates that the described activity is one that must NOT be engaged in when following the plan. - *

- */ - public Activity setProhibited(BooleanDt theValue) { - myProhibited = theValue; - return this; - } - - /** - * Sets the value for prohibited (Do NOT do) - * - *

- * Definition: - * If true, indicates that the described activity is one that must NOT be engaged in when following the plan. - *

- */ - public Activity setProhibited( boolean theBoolean) { - myProhibited = new BooleanDt(theBoolean); - return this; - } - - - /** - * Gets the value(s) for actionResulting (Appointments, orders, etc.). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc. - *

- */ - public java.util.List getActionResulting() { - if (myActionResulting == null) { - myActionResulting = new java.util.ArrayList(); - } - return myActionResulting; - } - - /** - * Sets the value(s) for actionResulting (Appointments, orders, etc.) - * - *

- * Definition: - * Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc. - *

- */ - public Activity setActionResulting(java.util.List theValue) { - myActionResulting = theValue; - return this; - } - - /** - * Adds and returns a new value for actionResulting (Appointments, orders, etc.) - * - *

- * Definition: - * Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc. - *

- */ - public ResourceReferenceDt addActionResulting() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getActionResulting().add(newType); - return newType; - } - - /** - * Gets the value(s) for notes (Comments about the activity). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Notes about the execution of the activity - *

- */ - public StringDt getNotes() { - if (myNotes == null) { - myNotes = new StringDt(); - } - return myNotes; - } - - /** - * Sets the value(s) for notes (Comments about the activity) - * - *

- * Definition: - * Notes about the execution of the activity - *

- */ - public Activity setNotes(StringDt theValue) { - myNotes = theValue; - return this; - } - - /** - * Sets the value for notes (Comments about the activity) - * - *

- * Definition: - * Notes about the execution of the activity - *

- */ - public Activity setNotes( String theString) { - myNotes = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for detail (Activity details defined in specific resource). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The details of the proposed activity represented in a specific resource - *

- */ - public ResourceReferenceDt getDetail() { - if (myDetail == null) { - myDetail = new ResourceReferenceDt(); - } - return myDetail; - } - - /** - * Sets the value(s) for detail (Activity details defined in specific resource) - * - *

- * Definition: - * The details of the proposed activity represented in a specific resource - *

- */ - public Activity setDetail(ResourceReferenceDt theValue) { - myDetail = theValue; - return this; - } - - - /** - * Gets the value(s) for simple (Activity details summarised here). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc - *

- */ - public ActivitySimple getSimple() { - if (mySimple == null) { - mySimple = new ActivitySimple(); - } - return mySimple; - } - - /** - * Sets the value(s) for simple (Activity details summarised here) - * - *

- * Definition: - * A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc - *

- */ - public Activity setSimple(ActivitySimple theValue) { - mySimple = theValue; - return this; - } - - - - } - - /** - * Block class for child element: CarePlan.activity.simple (Activity details summarised here) - * - *

- * Definition: - * A simple summary of details suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc - *

- */ - @Block() - public static class ActivitySimple extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="category", type=CodeDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="diet | drug | encounter | observation | procedure | supply | other", - formalDefinition="High-level categorization of the type of activity in a care plan." - ) - private BoundCodeDt myCategory; - - @Child(name="code", type=CodeableConceptDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Detail type of activity", - formalDefinition="Detailed description of the type of activity. E.g. What lab test, what procedure, what kind of encounter." - ) - private CodeableConceptDt myCode; - - @Child(name="timing", order=2, min=0, max=1, type={ - ScheduleDt.class, PeriodDt.class, StringDt.class }) - @Description( - shortDefinition="When activity is to occur", - formalDefinition="The period, timing or frequency upon which the described activity is to occur." - ) - private IDatatype myTiming; - - @Child(name="location", order=3, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Location.class }) - @Description( - shortDefinition="Where it should happen", - formalDefinition="Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc." - ) - private ResourceReferenceDt myLocation; - - @Child(name="performer", order=4, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Organization.class, ca.uhn.fhir.model.dstu.resource.RelatedPerson.class, ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="Who's responsible?", - formalDefinition="Identifies who's expected to be involved in the activity." - ) - private java.util.List myPerformer; - - @Child(name="product", order=5, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Medication.class, ca.uhn.fhir.model.dstu.resource.Substance.class }) - @Description( - shortDefinition="What's administered/supplied", - formalDefinition="Identifies the food, drug or other product being consumed or supplied in the activity." - ) - private ResourceReferenceDt myProduct; - - @Child(name="dailyAmount", type=QuantityDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="How much consumed/day?", - formalDefinition="Identifies the quantity expected to be consumed in a given day." - ) - private QuantityDt myDailyAmount; - - @Child(name="quantity", type=QuantityDt.class, order=7, min=0, max=1) - @Description( - shortDefinition="How much is administered/supplied/consumed", - formalDefinition="Identifies the quantity expected to be supplied." - ) - private QuantityDt myQuantity; - - @Child(name="details", type=StringDt.class, order=8, min=0, max=1) - @Description( - shortDefinition="Extra info on activity occurrence", - formalDefinition="This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc." - ) - private StringDt myDetails; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCategory, myCode, myTiming, myLocation, myPerformer, myProduct, myDailyAmount, myQuantity, myDetails); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCategory, myCode, myTiming, myLocation, myPerformer, myProduct, myDailyAmount, myQuantity, myDetails); - } - - /** - * Gets the value(s) for category (diet | drug | encounter | observation | procedure | supply | other). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * High-level categorization of the type of activity in a care plan. - *

- */ - public BoundCodeDt getCategory() { - if (myCategory == null) { - myCategory = new BoundCodeDt(CarePlanActivityCategoryEnum.VALUESET_BINDER); - } - return myCategory; - } - - /** - * Sets the value(s) for category (diet | drug | encounter | observation | procedure | supply | other) - * - *

- * Definition: - * High-level categorization of the type of activity in a care plan. - *

- */ - public ActivitySimple setCategory(BoundCodeDt theValue) { - myCategory = theValue; - return this; - } - - /** - * Sets the value(s) for category (diet | drug | encounter | observation | procedure | supply | other) - * - *

- * Definition: - * High-level categorization of the type of activity in a care plan. - *

- */ - public ActivitySimple setCategory(CarePlanActivityCategoryEnum theValue) { - getCategory().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for code (Detail type of activity). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Detailed description of the type of activity. E.g. What lab test, what procedure, what kind of encounter. - *

- */ - public CodeableConceptDt getCode() { - if (myCode == null) { - myCode = new CodeableConceptDt(); - } - return myCode; - } - - /** - * Sets the value(s) for code (Detail type of activity) - * - *

- * Definition: - * Detailed description of the type of activity. E.g. What lab test, what procedure, what kind of encounter. - *

- */ - public ActivitySimple setCode(CodeableConceptDt theValue) { - myCode = theValue; - return this; - } - - - /** - * Gets the value(s) for timing[x] (When activity is to occur). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The period, timing or frequency upon which the described activity is to occur. - *

- */ - public IDatatype getTiming() { - return myTiming; - } - - /** - * Sets the value(s) for timing[x] (When activity is to occur) - * - *

- * Definition: - * The period, timing or frequency upon which the described activity is to occur. - *

- */ - public ActivitySimple setTiming(IDatatype theValue) { - myTiming = theValue; - return this; - } - - - /** - * Gets the value(s) for location (Where it should happen). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc. - *

- */ - public ResourceReferenceDt getLocation() { - if (myLocation == null) { - myLocation = new ResourceReferenceDt(); - } - return myLocation; - } - - /** - * Sets the value(s) for location (Where it should happen) - * - *

- * Definition: - * Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc. - *

- */ - public ActivitySimple setLocation(ResourceReferenceDt theValue) { - myLocation = theValue; - return this; - } - - - /** - * Gets the value(s) for performer (Who's responsible?). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies who's expected to be involved in the activity. - *

- */ - public java.util.List getPerformer() { - if (myPerformer == null) { - myPerformer = new java.util.ArrayList(); - } - return myPerformer; - } - - /** - * Sets the value(s) for performer (Who's responsible?) - * - *

- * Definition: - * Identifies who's expected to be involved in the activity. - *

- */ - public ActivitySimple setPerformer(java.util.List theValue) { - myPerformer = theValue; - return this; - } - - /** - * Adds and returns a new value for performer (Who's responsible?) - * - *

- * Definition: - * Identifies who's expected to be involved in the activity. - *

- */ - public ResourceReferenceDt addPerformer() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getPerformer().add(newType); - return newType; - } - - /** - * Gets the value(s) for product (What's administered/supplied). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the food, drug or other product being consumed or supplied in the activity. - *

- */ - public ResourceReferenceDt getProduct() { - if (myProduct == null) { - myProduct = new ResourceReferenceDt(); - } - return myProduct; - } - - /** - * Sets the value(s) for product (What's administered/supplied) - * - *

- * Definition: - * Identifies the food, drug or other product being consumed or supplied in the activity. - *

- */ - public ActivitySimple setProduct(ResourceReferenceDt theValue) { - myProduct = theValue; - return this; - } - - - /** - * Gets the value(s) for dailyAmount (How much consumed/day?). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the quantity expected to be consumed in a given day. - *

- */ - public QuantityDt getDailyAmount() { - if (myDailyAmount == null) { - myDailyAmount = new QuantityDt(); - } - return myDailyAmount; - } - - /** - * Sets the value(s) for dailyAmount (How much consumed/day?) - * - *

- * Definition: - * Identifies the quantity expected to be consumed in a given day. - *

- */ - public ActivitySimple setDailyAmount(QuantityDt theValue) { - myDailyAmount = theValue; - return this; - } - - /** - * Sets the value for dailyAmount (How much consumed/day?) - * - *

- * Definition: - * Identifies the quantity expected to be consumed in a given day. - *

- */ - public ActivitySimple setDailyAmount( QuantityCompararatorEnum theComparator, double theValue, String theUnits) { - myDailyAmount = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for dailyAmount (How much consumed/day?) - * - *

- * Definition: - * Identifies the quantity expected to be consumed in a given day. - *

- */ - public ActivitySimple setDailyAmount( QuantityCompararatorEnum theComparator, long theValue, String theUnits) { - myDailyAmount = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for dailyAmount (How much consumed/day?) - * - *

- * Definition: - * Identifies the quantity expected to be consumed in a given day. - *

- */ - public ActivitySimple setDailyAmount( QuantityCompararatorEnum theComparator, double theValue, String theSystem, String theUnits) { - myDailyAmount = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for dailyAmount (How much consumed/day?) - * - *

- * Definition: - * Identifies the quantity expected to be consumed in a given day. - *

- */ - public ActivitySimple setDailyAmount( QuantityCompararatorEnum theComparator, long theValue, String theSystem, String theUnits) { - myDailyAmount = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for dailyAmount (How much consumed/day?) - * - *

- * Definition: - * Identifies the quantity expected to be consumed in a given day. - *

- */ - public ActivitySimple setDailyAmount( double theValue) { - myDailyAmount = new QuantityDt(theValue); - return this; - } - - /** - * Sets the value for dailyAmount (How much consumed/day?) - * - *

- * Definition: - * Identifies the quantity expected to be consumed in a given day. - *

- */ - public ActivitySimple setDailyAmount( long theValue) { - myDailyAmount = new QuantityDt(theValue); - return this; - } - - - /** - * Gets the value(s) for quantity (How much is administered/supplied/consumed). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the quantity expected to be supplied. - *

- */ - public QuantityDt getQuantity() { - if (myQuantity == null) { - myQuantity = new QuantityDt(); - } - return myQuantity; - } - - /** - * Sets the value(s) for quantity (How much is administered/supplied/consumed) - * - *

- * Definition: - * Identifies the quantity expected to be supplied. - *

- */ - public ActivitySimple setQuantity(QuantityDt theValue) { - myQuantity = theValue; - return this; - } - - /** - * Sets the value for quantity (How much is administered/supplied/consumed) - * - *

- * Definition: - * Identifies the quantity expected to be supplied. - *

- */ - public ActivitySimple setQuantity( QuantityCompararatorEnum theComparator, double theValue, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for quantity (How much is administered/supplied/consumed) - * - *

- * Definition: - * Identifies the quantity expected to be supplied. - *

- */ - public ActivitySimple setQuantity( QuantityCompararatorEnum theComparator, long theValue, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for quantity (How much is administered/supplied/consumed) - * - *

- * Definition: - * Identifies the quantity expected to be supplied. - *

- */ - public ActivitySimple setQuantity( QuantityCompararatorEnum theComparator, double theValue, String theSystem, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for quantity (How much is administered/supplied/consumed) - * - *

- * Definition: - * Identifies the quantity expected to be supplied. - *

- */ - public ActivitySimple setQuantity( QuantityCompararatorEnum theComparator, long theValue, String theSystem, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for quantity (How much is administered/supplied/consumed) - * - *

- * Definition: - * Identifies the quantity expected to be supplied. - *

- */ - public ActivitySimple setQuantity( double theValue) { - myQuantity = new QuantityDt(theValue); - return this; - } - - /** - * Sets the value for quantity (How much is administered/supplied/consumed) - * - *

- * Definition: - * Identifies the quantity expected to be supplied. - *

- */ - public ActivitySimple setQuantity( long theValue) { - myQuantity = new QuantityDt(theValue); - return this; - } - - - /** - * Gets the value(s) for details (Extra info on activity occurrence). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc. - *

- */ - public StringDt getDetails() { - if (myDetails == null) { - myDetails = new StringDt(); - } - return myDetails; - } - - /** - * Sets the value(s) for details (Extra info on activity occurrence) - * - *

- * Definition: - * This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc. - *

- */ - public ActivitySimple setDetails(StringDt theValue) { - myDetails = theValue; - return this; - } - - /** - * Sets the value for details (Extra info on activity occurrence) - * - *

- * Definition: - * This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc. - *

- */ - public ActivitySimple setDetails( String theString) { - myDetails = new StringDt(theString); - return this; - } - - - - } - - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Claim.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Claim.java deleted file mode 100644 index c10a2de0974..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Claim.java +++ /dev/null @@ -1,2034 +0,0 @@ - - - - - - - - - - - - - - - - -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.AddressDt; -import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.composite.HumanNameDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.primitive.DateDt; -import ca.uhn.fhir.model.primitive.DecimalDt; -import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR Claim Resource - * (A claim) - * - *

- * Definition: - * A claim - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Claim - *

- * - */ -@ResourceDef(name="Claim", profile="http://hl7.org/fhir/profiles/Claim", id="claim") -public class Claim extends BaseResource implements IResource { - - /** - * Search parameter constant for number - *

- * Description:
- * Type: token
- * Path: Claim.number
- *

- */ - @SearchParamDefinition(name="number", path="Claim.number", description="", type="token" ) - public static final String SP_NUMBER = "number"; - - /** - * Fluent Client search parameter constant for number - *

- * Description:
- * Type: token
- * Path: Claim.number
- *

- */ - public static final TokenClientParam NUMBER = new TokenClientParam(SP_NUMBER); - - - @Child(name="number", type=IdentifierDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Claim/Invoice number", - formalDefinition="The claim issuer and claim number" - ) - private IdentifierDt myNumber; - - @Child(name="servicedate", type=DateDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Date of Service", - formalDefinition="The date when the enclosed suite of services were performed or completed" - ) - private DateDt myServicedate; - - @Child(name="provider", order=2, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class }) - @Description( - shortDefinition="Responsible practitioner", - formalDefinition="The practitioner who is responsible for the services rendered to the patient" - ) - private ResourceReferenceDt myProvider; - - @Child(name="billingProvider", order=3, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class }) - @Description( - shortDefinition="Provider who is the payee", - formalDefinition="The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned)" - ) - private ResourceReferenceDt myBillingProvider; - - @Child(name="referrer", order=4, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class }) - @Description( - shortDefinition="Provider who is the payee", - formalDefinition="" - ) - private ResourceReferenceDt myReferrer; - - @Child(name="reason", type=CodeableConceptDt.class, order=5, min=0, max=1) - @Description( - shortDefinition="Referal Reason", - formalDefinition="The reason code for the referral" - ) - private CodeableConceptDt myReason; - - @Child(name="patient", order=6, min=1, max=1) - @Description( - shortDefinition="Patient Details", - formalDefinition="Patient Details." - ) - private Patient myPatient; - - @Child(name="coverage", order=7, min=0, max=1) - @Description( - shortDefinition="Insurance or medical plan", - formalDefinition="Financial instrument by which payment information for health care" - ) - private Coverage myCoverage; - - @Child(name="exception", type=CodeableConceptDt.class, order=8, min=0, max=1) - @Description( - shortDefinition="Eligibility exceptions", - formalDefinition="Factors which may influence the appicability of coverage" - ) - private CodeableConceptDt myException; - - @Child(name="relationship", type=CodeableConceptDt.class, order=9, min=0, max=1) - @Description( - shortDefinition="Patient relationship to subscriber", - formalDefinition="The relationship of the patient to the subscriber" - ) - private CodeableConceptDt myRelationship; - - @Child(name="school", type=StringDt.class, order=10, min=0, max=1) - @Description( - shortDefinition="Name of School", - formalDefinition="Name of school" - ) - private StringDt mySchool; - - @Child(name="service", order=11, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Service Details", - formalDefinition="" - ) - private java.util.List myService; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myNumber, myServicedate, myProvider, myBillingProvider, myReferrer, myReason, myPatient, myCoverage, myException, myRelationship, mySchool, myService); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myNumber, myServicedate, myProvider, myBillingProvider, myReferrer, myReason, myPatient, myCoverage, myException, myRelationship, mySchool, myService); - } - - /** - * Gets the value(s) for number (Claim/Invoice number). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The claim issuer and claim number - *

- */ - public IdentifierDt getNumber() { - if (myNumber == null) { - myNumber = new IdentifierDt(); - } - return myNumber; - } - - /** - * Sets the value(s) for number (Claim/Invoice number) - * - *

- * Definition: - * The claim issuer and claim number - *

- */ - public Claim setNumber(IdentifierDt theValue) { - myNumber = theValue; - return this; - } - - /** - * Sets the value for number (Claim/Invoice number) - * - *

- * Definition: - * The claim issuer and claim number - *

- */ - public Claim setNumber( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - myNumber = new IdentifierDt(theUse, theSystem, theValue, theLabel); - return this; - } - - /** - * Sets the value for number (Claim/Invoice number) - * - *

- * Definition: - * The claim issuer and claim number - *

- */ - public Claim setNumber( String theSystem, String theValue) { - myNumber = new IdentifierDt(theSystem, theValue); - return this; - } - - - /** - * Gets the value(s) for servicedate (Date of Service). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The date when the enclosed suite of services were performed or completed - *

- */ - public DateDt getServicedate() { - if (myServicedate == null) { - myServicedate = new DateDt(); - } - return myServicedate; - } - - /** - * Sets the value(s) for servicedate (Date of Service) - * - *

- * Definition: - * The date when the enclosed suite of services were performed or completed - *

- */ - public Claim setServicedate(DateDt theValue) { - myServicedate = theValue; - return this; - } - - /** - * Sets the value for servicedate (Date of Service) - * - *

- * Definition: - * The date when the enclosed suite of services were performed or completed - *

- */ - public Claim setServicedateWithDayPrecision( Date theDate) { - myServicedate = new DateDt(theDate); - return this; - } - - /** - * Sets the value for servicedate (Date of Service) - * - *

- * Definition: - * The date when the enclosed suite of services were performed or completed - *

- */ - public Claim setServicedate( Date theDate, TemporalPrecisionEnum thePrecision) { - myServicedate = new DateDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for provider (Responsible practitioner). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The practitioner who is responsible for the services rendered to the patient - *

- */ - public ResourceReferenceDt getProvider() { - if (myProvider == null) { - myProvider = new ResourceReferenceDt(); - } - return myProvider; - } - - /** - * Sets the value(s) for provider (Responsible practitioner) - * - *

- * Definition: - * The practitioner who is responsible for the services rendered to the patient - *

- */ - public Claim setProvider(ResourceReferenceDt theValue) { - myProvider = theValue; - return this; - } - - - /** - * Gets the value(s) for billingProvider (Provider who is the payee). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned) - *

- */ - public ResourceReferenceDt getBillingProvider() { - if (myBillingProvider == null) { - myBillingProvider = new ResourceReferenceDt(); - } - return myBillingProvider; - } - - /** - * Sets the value(s) for billingProvider (Provider who is the payee) - * - *

- * Definition: - * The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned) - *

- */ - public Claim setBillingProvider(ResourceReferenceDt theValue) { - myBillingProvider = theValue; - return this; - } - - - /** - * Gets the value(s) for referrer (Provider who is the payee). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt getReferrer() { - if (myReferrer == null) { - myReferrer = new ResourceReferenceDt(); - } - return myReferrer; - } - - /** - * Sets the value(s) for referrer (Provider who is the payee) - * - *

- * Definition: - * - *

- */ - public Claim setReferrer(ResourceReferenceDt theValue) { - myReferrer = theValue; - return this; - } - - - /** - * Gets the value(s) for reason (Referal Reason). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The reason code for the referral - *

- */ - public CodeableConceptDt getReason() { - if (myReason == null) { - myReason = new CodeableConceptDt(); - } - return myReason; - } - - /** - * Sets the value(s) for reason (Referal Reason) - * - *

- * Definition: - * The reason code for the referral - *

- */ - public Claim setReason(CodeableConceptDt theValue) { - myReason = theValue; - return this; - } - - - /** - * Gets the value(s) for patient (Patient Details). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Patient Details. - *

- */ - public Patient getPatient() { - if (myPatient == null) { - myPatient = new Patient(); - } - return myPatient; - } - - /** - * Sets the value(s) for patient (Patient Details) - * - *

- * Definition: - * Patient Details. - *

- */ - public Claim setPatient(Patient theValue) { - myPatient = theValue; - return this; - } - - - /** - * Gets the value(s) for coverage (Insurance or medical plan). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Financial instrument by which payment information for health care - *

- */ - public Coverage getCoverage() { - if (myCoverage == null) { - myCoverage = new Coverage(); - } - return myCoverage; - } - - /** - * Sets the value(s) for coverage (Insurance or medical plan) - * - *

- * Definition: - * Financial instrument by which payment information for health care - *

- */ - public Claim setCoverage(Coverage theValue) { - myCoverage = theValue; - return this; - } - - - /** - * Gets the value(s) for exception (Eligibility exceptions). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Factors which may influence the appicability of coverage - *

- */ - public CodeableConceptDt getException() { - if (myException == null) { - myException = new CodeableConceptDt(); - } - return myException; - } - - /** - * Sets the value(s) for exception (Eligibility exceptions) - * - *

- * Definition: - * Factors which may influence the appicability of coverage - *

- */ - public Claim setException(CodeableConceptDt theValue) { - myException = theValue; - return this; - } - - - /** - * Gets the value(s) for relationship (Patient relationship to subscriber). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The relationship of the patient to the subscriber - *

- */ - public CodeableConceptDt getRelationship() { - if (myRelationship == null) { - myRelationship = new CodeableConceptDt(); - } - return myRelationship; - } - - /** - * Sets the value(s) for relationship (Patient relationship to subscriber) - * - *

- * Definition: - * The relationship of the patient to the subscriber - *

- */ - public Claim setRelationship(CodeableConceptDt theValue) { - myRelationship = theValue; - return this; - } - - - /** - * Gets the value(s) for school (Name of School). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Name of school - *

- */ - public StringDt getSchool() { - if (mySchool == null) { - mySchool = new StringDt(); - } - return mySchool; - } - - /** - * Sets the value(s) for school (Name of School) - * - *

- * Definition: - * Name of school - *

- */ - public Claim setSchool(StringDt theValue) { - mySchool = theValue; - return this; - } - - /** - * Sets the value for school (Name of School) - * - *

- * Definition: - * Name of school - *

- */ - public Claim setSchool( String theString) { - mySchool = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for service (Service Details). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getService() { - if (myService == null) { - myService = new java.util.ArrayList(); - } - return myService; - } - - /** - * Sets the value(s) for service (Service Details) - * - *

- * Definition: - * - *

- */ - public Claim setService(java.util.List theValue) { - myService = theValue; - return this; - } - - /** - * Adds and returns a new value for service (Service Details) - * - *

- * Definition: - * - *

- */ - public Service addService() { - Service newType = new Service(); - getService().add(newType); - return newType; - } - - /** - * Gets the first repetition for service (Service Details), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public Service getServiceFirstRep() { - if (getService().isEmpty()) { - return addService(); - } - return getService().get(0); - } - - /** - * Block class for child element: Claim.patient (Patient Details) - * - *

- * Definition: - * Patient Details. - *

- */ - @Block() - public static class Patient extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="name", type=HumanNameDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Patient name", - formalDefinition="The name of the PolicyHolder" - ) - private HumanNameDt myName; - - @Child(name="address", type=AddressDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Patient address", - formalDefinition="The mailing address, typically home, of the PolicyHolder" - ) - private AddressDt myAddress; - - @Child(name="birthdate", type=DateDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Patient date of birth", - formalDefinition="The date of birth of the PolicyHolder" - ) - private DateDt myBirthdate; - - @Child(name="gender", type=CodingDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Gender", - formalDefinition="Gender." - ) - private CodingDt myGender; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myName, myAddress, myBirthdate, myGender); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myName, myAddress, myBirthdate, myGender); - } - - /** - * Gets the value(s) for name (Patient name). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The name of the PolicyHolder - *

- */ - public HumanNameDt getName() { - if (myName == null) { - myName = new HumanNameDt(); - } - return myName; - } - - /** - * Sets the value(s) for name (Patient name) - * - *

- * Definition: - * The name of the PolicyHolder - *

- */ - public Patient setName(HumanNameDt theValue) { - myName = theValue; - return this; - } - - - /** - * Gets the value(s) for address (Patient address). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The mailing address, typically home, of the PolicyHolder - *

- */ - public AddressDt getAddress() { - if (myAddress == null) { - myAddress = new AddressDt(); - } - return myAddress; - } - - /** - * Sets the value(s) for address (Patient address) - * - *

- * Definition: - * The mailing address, typically home, of the PolicyHolder - *

- */ - public Patient setAddress(AddressDt theValue) { - myAddress = theValue; - return this; - } - - - /** - * Gets the value(s) for birthdate (Patient date of birth). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The date of birth of the PolicyHolder - *

- */ - public DateDt getBirthdate() { - if (myBirthdate == null) { - myBirthdate = new DateDt(); - } - return myBirthdate; - } - - /** - * Sets the value(s) for birthdate (Patient date of birth) - * - *

- * Definition: - * The date of birth of the PolicyHolder - *

- */ - public Patient setBirthdate(DateDt theValue) { - myBirthdate = theValue; - return this; - } - - /** - * Sets the value for birthdate (Patient date of birth) - * - *

- * Definition: - * The date of birth of the PolicyHolder - *

- */ - public Patient setBirthdateWithDayPrecision( Date theDate) { - myBirthdate = new DateDt(theDate); - return this; - } - - /** - * Sets the value for birthdate (Patient date of birth) - * - *

- * Definition: - * The date of birth of the PolicyHolder - *

- */ - public Patient setBirthdate( Date theDate, TemporalPrecisionEnum thePrecision) { - myBirthdate = new DateDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for gender (Gender). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Gender. - *

- */ - public CodingDt getGender() { - if (myGender == null) { - myGender = new CodingDt(); - } - return myGender; - } - - /** - * Sets the value(s) for gender (Gender) - * - *

- * Definition: - * Gender. - *

- */ - public Patient setGender(CodingDt theValue) { - myGender = theValue; - return this; - } - - - - } - - - /** - * Block class for child element: Claim.coverage (Insurance or medical plan) - * - *

- * Definition: - * Financial instrument by which payment information for health care - *

- */ - @Block() - public static class Coverage extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="issuer", order=0, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Organization.class }) - @Description( - shortDefinition="An identifier for the plan issuer", - formalDefinition="The program or plan underwriter or payor." - ) - private ResourceReferenceDt myIssuer; - - @Child(name="period", type=PeriodDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Coverage start and end dates", - formalDefinition="Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force." - ) - private PeriodDt myPeriod; - - @Child(name="type", type=CodingDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="Type of coverage", - formalDefinition="The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health." - ) - private CodingDt myType; - - @Child(name="identifier", type=IdentifierDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="The primary coverage ID", - formalDefinition="The main (and possibly only) identifier for the coverage - often referred to as a Subscriber Id, Certificate number or Personal Health Number or Case ID." - ) - private IdentifierDt myIdentifier; - - @Child(name="group", type=IdentifierDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="An identifier for the group", - formalDefinition="Todo" - ) - private IdentifierDt myGroup; - - @Child(name="plan", type=IdentifierDt.class, order=5, min=0, max=1) - @Description( - shortDefinition="An identifier for the plan", - formalDefinition="Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID." - ) - private IdentifierDt myPlan; - - @Child(name="subplan", type=IdentifierDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="An identifier for the subsection of the plan", - formalDefinition="Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID." - ) - private IdentifierDt mySubplan; - - @Child(name="dependent", type=IntegerDt.class, order=7, min=0, max=1) - @Description( - shortDefinition="The dependent number", - formalDefinition="A unique identifier for a dependent under the coverage." - ) - private IntegerDt myDependent; - - @Child(name="sequence", type=IntegerDt.class, order=8, min=0, max=1) - @Description( - shortDefinition="The plan instance or sequence counter", - formalDefinition="An optional counter for a particular instance of the identified coverage which increments upon each renewal." - ) - private IntegerDt mySequence; - - @Child(name="subscriber", order=9, min=0, max=1) - @Description( - shortDefinition="Planholder information", - formalDefinition="Th demographics for the individual in whose name the insurance coverage is issued." - ) - private CoverageSubscriber mySubscriber; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIssuer, myPeriod, myType, myIdentifier, myGroup, myPlan, mySubplan, myDependent, mySequence, mySubscriber); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIssuer, myPeriod, myType, myIdentifier, myGroup, myPlan, mySubplan, myDependent, mySequence, mySubscriber); - } - - /** - * Gets the value(s) for issuer (An identifier for the plan issuer). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The program or plan underwriter or payor. - *

- */ - public ResourceReferenceDt getIssuer() { - if (myIssuer == null) { - myIssuer = new ResourceReferenceDt(); - } - return myIssuer; - } - - /** - * Sets the value(s) for issuer (An identifier for the plan issuer) - * - *

- * Definition: - * The program or plan underwriter or payor. - *

- */ - public Coverage setIssuer(ResourceReferenceDt theValue) { - myIssuer = theValue; - return this; - } - - - /** - * Gets the value(s) for period (Coverage start and end dates). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force. - *

- */ - public PeriodDt getPeriod() { - if (myPeriod == null) { - myPeriod = new PeriodDt(); - } - return myPeriod; - } - - /** - * Sets the value(s) for period (Coverage start and end dates) - * - *

- * Definition: - * Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force. - *

- */ - public Coverage setPeriod(PeriodDt theValue) { - myPeriod = theValue; - return this; - } - - - /** - * Gets the value(s) for type (Type of coverage). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health. - *

- */ - public CodingDt getType() { - if (myType == null) { - myType = new CodingDt(); - } - return myType; - } - - /** - * Sets the value(s) for type (Type of coverage) - * - *

- * Definition: - * The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health. - *

- */ - public Coverage setType(CodingDt theValue) { - myType = theValue; - return this; - } - - - /** - * Gets the value(s) for identifier (The primary coverage ID). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The main (and possibly only) identifier for the coverage - often referred to as a Subscriber Id, Certificate number or Personal Health Number or Case ID. - *

- */ - public IdentifierDt getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new IdentifierDt(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (The primary coverage ID) - * - *

- * Definition: - * The main (and possibly only) identifier for the coverage - often referred to as a Subscriber Id, Certificate number or Personal Health Number or Case ID. - *

- */ - public Coverage setIdentifier(IdentifierDt theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Sets the value for identifier (The primary coverage ID) - * - *

- * Definition: - * The main (and possibly only) identifier for the coverage - often referred to as a Subscriber Id, Certificate number or Personal Health Number or Case ID. - *

- */ - public Coverage setIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - myIdentifier = new IdentifierDt(theUse, theSystem, theValue, theLabel); - return this; - } - - /** - * Sets the value for identifier (The primary coverage ID) - * - *

- * Definition: - * The main (and possibly only) identifier for the coverage - often referred to as a Subscriber Id, Certificate number or Personal Health Number or Case ID. - *

- */ - public Coverage setIdentifier( String theSystem, String theValue) { - myIdentifier = new IdentifierDt(theSystem, theValue); - return this; - } - - - /** - * Gets the value(s) for group (An identifier for the group). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Todo - *

- */ - public IdentifierDt getGroup() { - if (myGroup == null) { - myGroup = new IdentifierDt(); - } - return myGroup; - } - - /** - * Sets the value(s) for group (An identifier for the group) - * - *

- * Definition: - * Todo - *

- */ - public Coverage setGroup(IdentifierDt theValue) { - myGroup = theValue; - return this; - } - - /** - * Sets the value for group (An identifier for the group) - * - *

- * Definition: - * Todo - *

- */ - public Coverage setGroup( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - myGroup = new IdentifierDt(theUse, theSystem, theValue, theLabel); - return this; - } - - /** - * Sets the value for group (An identifier for the group) - * - *

- * Definition: - * Todo - *

- */ - public Coverage setGroup( String theSystem, String theValue) { - myGroup = new IdentifierDt(theSystem, theValue); - return this; - } - - - /** - * Gets the value(s) for plan (An identifier for the plan). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. - *

- */ - public IdentifierDt getPlan() { - if (myPlan == null) { - myPlan = new IdentifierDt(); - } - return myPlan; - } - - /** - * Sets the value(s) for plan (An identifier for the plan) - * - *

- * Definition: - * Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. - *

- */ - public Coverage setPlan(IdentifierDt theValue) { - myPlan = theValue; - return this; - } - - /** - * Sets the value for plan (An identifier for the plan) - * - *

- * Definition: - * Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. - *

- */ - public Coverage setPlan( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - myPlan = new IdentifierDt(theUse, theSystem, theValue, theLabel); - return this; - } - - /** - * Sets the value for plan (An identifier for the plan) - * - *

- * Definition: - * Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. - *

- */ - public Coverage setPlan( String theSystem, String theValue) { - myPlan = new IdentifierDt(theSystem, theValue); - return this; - } - - - /** - * Gets the value(s) for subplan (An identifier for the subsection of the plan). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID. - *

- */ - public IdentifierDt getSubplan() { - if (mySubplan == null) { - mySubplan = new IdentifierDt(); - } - return mySubplan; - } - - /** - * Sets the value(s) for subplan (An identifier for the subsection of the plan) - * - *

- * Definition: - * Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID. - *

- */ - public Coverage setSubplan(IdentifierDt theValue) { - mySubplan = theValue; - return this; - } - - /** - * Sets the value for subplan (An identifier for the subsection of the plan) - * - *

- * Definition: - * Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID. - *

- */ - public Coverage setSubplan( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - mySubplan = new IdentifierDt(theUse, theSystem, theValue, theLabel); - return this; - } - - /** - * Sets the value for subplan (An identifier for the subsection of the plan) - * - *

- * Definition: - * Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID. - *

- */ - public Coverage setSubplan( String theSystem, String theValue) { - mySubplan = new IdentifierDt(theSystem, theValue); - return this; - } - - - /** - * Gets the value(s) for dependent (The dependent number). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A unique identifier for a dependent under the coverage. - *

- */ - public IntegerDt getDependent() { - if (myDependent == null) { - myDependent = new IntegerDt(); - } - return myDependent; - } - - /** - * Sets the value(s) for dependent (The dependent number) - * - *

- * Definition: - * A unique identifier for a dependent under the coverage. - *

- */ - public Coverage setDependent(IntegerDt theValue) { - myDependent = theValue; - return this; - } - - /** - * Sets the value for dependent (The dependent number) - * - *

- * Definition: - * A unique identifier for a dependent under the coverage. - *

- */ - public Coverage setDependent( int theInteger) { - myDependent = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for sequence (The plan instance or sequence counter). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * An optional counter for a particular instance of the identified coverage which increments upon each renewal. - *

- */ - public IntegerDt getSequence() { - if (mySequence == null) { - mySequence = new IntegerDt(); - } - return mySequence; - } - - /** - * Sets the value(s) for sequence (The plan instance or sequence counter) - * - *

- * Definition: - * An optional counter for a particular instance of the identified coverage which increments upon each renewal. - *

- */ - public Coverage setSequence(IntegerDt theValue) { - mySequence = theValue; - return this; - } - - /** - * Sets the value for sequence (The plan instance or sequence counter) - * - *

- * Definition: - * An optional counter for a particular instance of the identified coverage which increments upon each renewal. - *

- */ - public Coverage setSequence( int theInteger) { - mySequence = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for subscriber (Planholder information). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Th demographics for the individual in whose name the insurance coverage is issued. - *

- */ - public CoverageSubscriber getSubscriber() { - if (mySubscriber == null) { - mySubscriber = new CoverageSubscriber(); - } - return mySubscriber; - } - - /** - * Sets the value(s) for subscriber (Planholder information) - * - *

- * Definition: - * Th demographics for the individual in whose name the insurance coverage is issued. - *

- */ - public Coverage setSubscriber(CoverageSubscriber theValue) { - mySubscriber = theValue; - return this; - } - - - - } - - /** - * Block class for child element: Claim.coverage.subscriber (Planholder information) - * - *

- * Definition: - * Th demographics for the individual in whose name the insurance coverage is issued. - *

- */ - @Block() - public static class CoverageSubscriber extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="name", type=HumanNameDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="PolicyHolder name", - formalDefinition="The name of the PolicyHolder" - ) - private HumanNameDt myName; - - @Child(name="address", type=AddressDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="PolicyHolder address", - formalDefinition="The mailing address, typically home, of the PolicyHolder" - ) - private AddressDt myAddress; - - @Child(name="birthdate", type=DateDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="PolicyHolder date of birth", - formalDefinition="The date of birth of the PolicyHolder" - ) - private DateDt myBirthdate; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myName, myAddress, myBirthdate); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myName, myAddress, myBirthdate); - } - - /** - * Gets the value(s) for name (PolicyHolder name). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The name of the PolicyHolder - *

- */ - public HumanNameDt getName() { - if (myName == null) { - myName = new HumanNameDt(); - } - return myName; - } - - /** - * Sets the value(s) for name (PolicyHolder name) - * - *

- * Definition: - * The name of the PolicyHolder - *

- */ - public CoverageSubscriber setName(HumanNameDt theValue) { - myName = theValue; - return this; - } - - - /** - * Gets the value(s) for address (PolicyHolder address). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The mailing address, typically home, of the PolicyHolder - *

- */ - public AddressDt getAddress() { - if (myAddress == null) { - myAddress = new AddressDt(); - } - return myAddress; - } - - /** - * Sets the value(s) for address (PolicyHolder address) - * - *

- * Definition: - * The mailing address, typically home, of the PolicyHolder - *

- */ - public CoverageSubscriber setAddress(AddressDt theValue) { - myAddress = theValue; - return this; - } - - - /** - * Gets the value(s) for birthdate (PolicyHolder date of birth). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The date of birth of the PolicyHolder - *

- */ - public DateDt getBirthdate() { - if (myBirthdate == null) { - myBirthdate = new DateDt(); - } - return myBirthdate; - } - - /** - * Sets the value(s) for birthdate (PolicyHolder date of birth) - * - *

- * Definition: - * The date of birth of the PolicyHolder - *

- */ - public CoverageSubscriber setBirthdate(DateDt theValue) { - myBirthdate = theValue; - return this; - } - - /** - * Sets the value for birthdate (PolicyHolder date of birth) - * - *

- * Definition: - * The date of birth of the PolicyHolder - *

- */ - public CoverageSubscriber setBirthdateWithDayPrecision( Date theDate) { - myBirthdate = new DateDt(theDate); - return this; - } - - /** - * Sets the value for birthdate (PolicyHolder date of birth) - * - *

- * Definition: - * The date of birth of the PolicyHolder - *

- */ - public CoverageSubscriber setBirthdate( Date theDate, TemporalPrecisionEnum thePrecision) { - myBirthdate = new DateDt(theDate, thePrecision); - return this; - } - - - - } - - - - /** - * Block class for child element: Claim.service (Service Details) - * - *

- * Definition: - * - *

- */ - @Block() - public static class Service extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="service", type=CodeableConceptDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Professional service code", - formalDefinition="The code for the professional service provided." - ) - private CodeableConceptDt myService; - - @Child(name="instance", type=IntegerDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="Service instance", - formalDefinition="A service line item." - ) - private IntegerDt myInstance; - - @Child(name="fee", type=DecimalDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Professional fee", - formalDefinition="" - ) - private DecimalDt myFee; - - @Child(name="location", type=CodeableConceptDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Service Location", - formalDefinition="Code for the oral cavity, tooth, quadrant, sextant or arch." - ) - private CodeableConceptDt myLocation; - - @Child(name="surface", type=CodeableConceptDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="Tooth surface", - formalDefinition="Tooth surface(s) involved in the restoration." - ) - private CodeableConceptDt mySurface; - - @Child(name="lab", order=5, min=0, max=1) - @Description( - shortDefinition="Lab Details", - formalDefinition="" - ) - private ServiceLab myLab; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myService, myInstance, myFee, myLocation, mySurface, myLab); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myService, myInstance, myFee, myLocation, mySurface, myLab); - } - - /** - * Gets the value(s) for service (Professional service code). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The code for the professional service provided. - *

- */ - public CodeableConceptDt getService() { - if (myService == null) { - myService = new CodeableConceptDt(); - } - return myService; - } - - /** - * Sets the value(s) for service (Professional service code) - * - *

- * Definition: - * The code for the professional service provided. - *

- */ - public Service setService(CodeableConceptDt theValue) { - myService = theValue; - return this; - } - - - /** - * Gets the value(s) for instance (Service instance). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A service line item. - *

- */ - public IntegerDt getInstance() { - if (myInstance == null) { - myInstance = new IntegerDt(); - } - return myInstance; - } - - /** - * Sets the value(s) for instance (Service instance) - * - *

- * Definition: - * A service line item. - *

- */ - public Service setInstance(IntegerDt theValue) { - myInstance = theValue; - return this; - } - - /** - * Sets the value for instance (Service instance) - * - *

- * Definition: - * A service line item. - *

- */ - public Service setInstance( int theInteger) { - myInstance = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for fee (Professional fee). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public DecimalDt getFee() { - if (myFee == null) { - myFee = new DecimalDt(); - } - return myFee; - } - - /** - * Sets the value(s) for fee (Professional fee) - * - *

- * Definition: - * - *

- */ - public Service setFee(DecimalDt theValue) { - myFee = theValue; - return this; - } - - /** - * Sets the value for fee (Professional fee) - * - *

- * Definition: - * - *

- */ - public Service setFee( long theValue) { - myFee = new DecimalDt(theValue); - return this; - } - - /** - * Sets the value for fee (Professional fee) - * - *

- * Definition: - * - *

- */ - public Service setFee( double theValue) { - myFee = new DecimalDt(theValue); - return this; - } - - /** - * Sets the value for fee (Professional fee) - * - *

- * Definition: - * - *

- */ - public Service setFee( java.math.BigDecimal theValue) { - myFee = new DecimalDt(theValue); - return this; - } - - - /** - * Gets the value(s) for location (Service Location). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Code for the oral cavity, tooth, quadrant, sextant or arch. - *

- */ - public CodeableConceptDt getLocation() { - if (myLocation == null) { - myLocation = new CodeableConceptDt(); - } - return myLocation; - } - - /** - * Sets the value(s) for location (Service Location) - * - *

- * Definition: - * Code for the oral cavity, tooth, quadrant, sextant or arch. - *

- */ - public Service setLocation(CodeableConceptDt theValue) { - myLocation = theValue; - return this; - } - - - /** - * Gets the value(s) for surface (Tooth surface). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Tooth surface(s) involved in the restoration. - *

- */ - public CodeableConceptDt getSurface() { - if (mySurface == null) { - mySurface = new CodeableConceptDt(); - } - return mySurface; - } - - /** - * Sets the value(s) for surface (Tooth surface) - * - *

- * Definition: - * Tooth surface(s) involved in the restoration. - *

- */ - public Service setSurface(CodeableConceptDt theValue) { - mySurface = theValue; - return this; - } - - - /** - * Gets the value(s) for lab (Lab Details). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ServiceLab getLab() { - if (myLab == null) { - myLab = new ServiceLab(); - } - return myLab; - } - - /** - * Sets the value(s) for lab (Lab Details) - * - *

- * Definition: - * - *

- */ - public Service setLab(ServiceLab theValue) { - myLab = theValue; - return this; - } - - - - } - - /** - * Block class for child element: Claim.service.lab (Lab Details) - * - *

- * Definition: - * - *

- */ - @Block() - public static class ServiceLab extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="service", type=CodeableConceptDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Lab service code", - formalDefinition="The code for the lab service provided." - ) - private CodeableConceptDt myService; - - @Child(name="fee", type=DecimalDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Lab fee", - formalDefinition="The amount to reimbuse for a laboratory service." - ) - private DecimalDt myFee; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myService, myFee); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myService, myFee); - } - - /** - * Gets the value(s) for service (Lab service code). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The code for the lab service provided. - *

- */ - public CodeableConceptDt getService() { - if (myService == null) { - myService = new CodeableConceptDt(); - } - return myService; - } - - /** - * Sets the value(s) for service (Lab service code) - * - *

- * Definition: - * The code for the lab service provided. - *

- */ - public ServiceLab setService(CodeableConceptDt theValue) { - myService = theValue; - return this; - } - - - /** - * Gets the value(s) for fee (Lab fee). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The amount to reimbuse for a laboratory service. - *

- */ - public DecimalDt getFee() { - if (myFee == null) { - myFee = new DecimalDt(); - } - return myFee; - } - - /** - * Sets the value(s) for fee (Lab fee) - * - *

- * Definition: - * The amount to reimbuse for a laboratory service. - *

- */ - public ServiceLab setFee(DecimalDt theValue) { - myFee = theValue; - return this; - } - - /** - * Sets the value for fee (Lab fee) - * - *

- * Definition: - * The amount to reimbuse for a laboratory service. - *

- */ - public ServiceLab setFee( long theValue) { - myFee = new DecimalDt(theValue); - return this; - } - - /** - * Sets the value for fee (Lab fee) - * - *

- * Definition: - * The amount to reimbuse for a laboratory service. - *

- */ - public ServiceLab setFee( double theValue) { - myFee = new DecimalDt(theValue); - return this; - } - - /** - * Sets the value for fee (Lab fee) - * - *

- * Definition: - * The amount to reimbuse for a laboratory service. - *

- */ - public ServiceLab setFee( java.math.BigDecimal theValue) { - myFee = new DecimalDt(theValue); - return this; - } - - - - } - - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Composition.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Composition.java deleted file mode 100644 index 194be2b3843..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Composition.java +++ /dev/null @@ -1,1699 +0,0 @@ - - - - - - - - - - - - - - - - -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.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.CompositionAttestationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.CompositionStatusEnum; -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.DateTimeDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.rest.gclient.DateClientParam; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR Composition Resource - * (A set of resources composed into a single coherent clinical statement with clinical attestation) - * - *

- * Definition: - * A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. - *

- * - *

- * Requirements: - * To support documents, and also to capture the EN13606 notion of an attested commit to the patient EHR, and to allow a set of disparate resources at the information/engineering level to be gathered into a clinical statement - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Composition - *

- * - */ -@ResourceDef(name="Composition", profile="http://hl7.org/fhir/profiles/Composition", id="composition") -public class Composition extends BaseResource implements IResource { - - /** - * Search parameter constant for type - *

- * Description:
- * Type: token
- * Path: Composition.type
- *

- */ - @SearchParamDefinition(name="type", path="Composition.type", description="", type="token" ) - public static final String SP_TYPE = "type"; - - /** - * Fluent Client search parameter constant for type - *

- * Description:
- * Type: token
- * Path: Composition.type
- *

- */ - public static final TokenClientParam TYPE = new TokenClientParam(SP_TYPE); - - /** - * Search parameter constant for class - *

- * Description:
- * Type: token
- * Path: Composition.class
- *

- */ - @SearchParamDefinition(name="class", path="Composition.class", description="", type="token" ) - public static final String SP_CLASS = "class"; - - /** - * Fluent Client search parameter constant for class - *

- * Description:
- * Type: token
- * Path: Composition.class
- *

- */ - public static final TokenClientParam CLASS = new TokenClientParam(SP_CLASS); - - /** - * Search parameter constant for date - *

- * Description:
- * Type: date
- * Path: Composition.date
- *

- */ - @SearchParamDefinition(name="date", path="Composition.date", description="", type="date" ) - public static final String SP_DATE = "date"; - - /** - * Fluent Client search parameter constant for date - *

- * Description:
- * Type: date
- * Path: Composition.date
- *

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

- * Description:
- * Type: reference
- * Path: Composition.subject
- *

- */ - @SearchParamDefinition(name="subject", path="Composition.subject", description="", type="reference" ) - public static final String SP_SUBJECT = "subject"; - - /** - * Fluent Client search parameter constant for subject - *

- * Description:
- * Type: reference
- * Path: Composition.subject
- *

- */ - public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Composition.subject". - */ - public static final Include INCLUDE_SUBJECT = new Include("Composition.subject"); - - /** - * Search parameter constant for author - *

- * Description:
- * Type: reference
- * Path: Composition.author
- *

- */ - @SearchParamDefinition(name="author", path="Composition.author", description="", type="reference" ) - public static final String SP_AUTHOR = "author"; - - /** - * Fluent Client search parameter constant for author - *

- * Description:
- * Type: reference
- * Path: Composition.author
- *

- */ - public static final ReferenceClientParam AUTHOR = new ReferenceClientParam(SP_AUTHOR); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Composition.author". - */ - public static final Include INCLUDE_AUTHOR = new Include("Composition.author"); - - /** - * Search parameter constant for attester - *

- * Description:
- * Type: reference
- * Path: Composition.attester.party
- *

- */ - @SearchParamDefinition(name="attester", path="Composition.attester.party", description="", type="reference" ) - public static final String SP_ATTESTER = "attester"; - - /** - * Fluent Client search parameter constant for attester - *

- * Description:
- * Type: reference
- * Path: Composition.attester.party
- *

- */ - public static final ReferenceClientParam ATTESTER = new ReferenceClientParam(SP_ATTESTER); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Composition.attester.party". - */ - public static final Include INCLUDE_ATTESTER_PARTY = new Include("Composition.attester.party"); - - /** - * Search parameter constant for context - *

- * Description:
- * Type: token
- * Path: Composition.event.code
- *

- */ - @SearchParamDefinition(name="context", path="Composition.event.code", description="", type="token" ) - public static final String SP_CONTEXT = "context"; - - /** - * Fluent Client search parameter constant for context - *

- * Description:
- * Type: token
- * Path: Composition.event.code
- *

- */ - public static final TokenClientParam CONTEXT = new TokenClientParam(SP_CONTEXT); - - /** - * Search parameter constant for section-type - *

- * Description:
- * Type: token
- * Path: Composition.section.code
- *

- */ - @SearchParamDefinition(name="section-type", path="Composition.section.code", description="", type="token" ) - public static final String SP_SECTION_TYPE = "section-type"; - - /** - * Fluent Client search parameter constant for section-type - *

- * Description:
- * Type: token
- * Path: Composition.section.code
- *

- */ - public static final TokenClientParam SECTION_TYPE = new TokenClientParam(SP_SECTION_TYPE); - - /** - * Search parameter constant for section-content - *

- * Description:
- * Type: reference
- * Path: Composition.section.content
- *

- */ - @SearchParamDefinition(name="section-content", path="Composition.section.content", description="", type="reference" ) - public static final String SP_SECTION_CONTENT = "section-content"; - - /** - * Fluent Client search parameter constant for section-content - *

- * Description:
- * Type: reference
- * Path: Composition.section.content
- *

- */ - public static final ReferenceClientParam SECTION_CONTENT = new ReferenceClientParam(SP_SECTION_CONTENT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Composition.section.content". - */ - public static final Include INCLUDE_SECTION_CONTENT = new Include("Composition.section.content"); - - /** - * Search parameter constant for identifier - *

- * Description:
- * Type: token
- * Path: Composition.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Composition.identifier", description="", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - - /** - * Fluent Client search parameter constant for identifier - *

- * Description:
- * Type: token
- * Path: Composition.identifier
- *

- */ - public static final TokenClientParam IDENTIFIER = new TokenClientParam(SP_IDENTIFIER); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Logical identifier of composition (version-independent)", - formalDefinition="Logical Identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time" - ) - private IdentifierDt myIdentifier; - - @Child(name="date", type=DateTimeDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="Composition editing time", - formalDefinition="The composition editing time, when the composition was last logically changed by the author" - ) - private DateTimeDt myDate; - - @Child(name="type", type=CodeableConceptDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="Kind of composition (LOINC if possible)", - formalDefinition="Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition" - ) - private CodeableConceptDt myType; - - @Child(name="class", type=CodeableConceptDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Categorization of Composition", - formalDefinition="A categorization for the type of the composition. This may be implied by or derived from the code specified in the Composition Type" - ) - private CodeableConceptDt myClassElement; - - @Child(name="title", type=StringDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="Human Readable name/title", - formalDefinition="Official human-readable label for the composition" - ) - private StringDt myTitle; - - @Child(name="status", type=CodeDt.class, order=5, min=1, max=1) - @Description( - shortDefinition="preliminary | final | appended | amended | entered in error", - formalDefinition="The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document" - ) - private BoundCodeDt myStatus; - - @Child(name="confidentiality", type=CodingDt.class, order=6, min=1, max=1) - @Description( - shortDefinition="As defined by affinity domain", - formalDefinition="The code specifying the level of confidentiality of the Composition" - ) - private CodingDt myConfidentiality; - - @Child(name="subject", order=7, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Group.class, ca.uhn.fhir.model.dstu.resource.Device.class, ca.uhn.fhir.model.dstu.resource.Location.class }) - @Description( - shortDefinition="Who and/or what the composition is about", - formalDefinition="Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure)" - ) - private ResourceReferenceDt mySubject; - - @Child(name="author", order=8, min=1, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Device.class, ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.RelatedPerson.class }) - @Description( - shortDefinition="Who and/or what authored the composition", - formalDefinition="Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.)" - ) - private java.util.List myAuthor; - - @Child(name="attester", order=9, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Attests to accuracy of composition", - formalDefinition="A participant who has attested to the accuracy of the composition/document" - ) - private java.util.List myAttester; - - @Child(name="custodian", order=10, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Organization.class }) - @Description( - shortDefinition="Org which maintains the composition", - formalDefinition="Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information" - ) - private ResourceReferenceDt myCustodian; - - @Child(name="event", order=11, min=0, max=1) - @Description( - shortDefinition="The clinical event/act/item being documented", - formalDefinition="The main event/act/item, such as a colonoscopy or an appendectomy, being documented" - ) - private Event myEvent; - - @Child(name="encounter", order=12, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Encounter.class }) - @Description( - shortDefinition="Context of the conposition", - formalDefinition="Describes the clinical encounter or type of care this documentation is associated with." - ) - private ResourceReferenceDt myEncounter; - - @Child(name="section", order=13, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Composition is broken into sections", - formalDefinition="The root of the sections that make up the composition" - ) - private java.util.List
mySection; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myDate, myType, myClassElement, myTitle, myStatus, myConfidentiality, mySubject, myAuthor, myAttester, myCustodian, myEvent, myEncounter, mySection); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myDate, myType, myClassElement, myTitle, myStatus, myConfidentiality, mySubject, myAuthor, myAttester, myCustodian, myEvent, myEncounter, mySection); - } - - /** - * Gets the value(s) for identifier (Logical identifier of composition (version-independent)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Logical Identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time - *

- */ - public IdentifierDt getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new IdentifierDt(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Logical identifier of composition (version-independent)) - * - *

- * Definition: - * Logical Identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time - *

- */ - public Composition setIdentifier(IdentifierDt theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Sets the value for identifier (Logical identifier of composition (version-independent)) - * - *

- * Definition: - * Logical Identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time - *

- */ - public Composition setIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - myIdentifier = new IdentifierDt(theUse, theSystem, theValue, theLabel); - return this; - } - - /** - * Sets the value for identifier (Logical identifier of composition (version-independent)) - * - *

- * Definition: - * Logical Identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time - *

- */ - public Composition setIdentifier( String theSystem, String theValue) { - myIdentifier = new IdentifierDt(theSystem, theValue); - return this; - } - - - /** - * Gets the value(s) for date (Composition editing time). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The composition editing time, when the composition was last logically changed by the author - *

- */ - public DateTimeDt getDate() { - if (myDate == null) { - myDate = new DateTimeDt(); - } - return myDate; - } - - /** - * Sets the value(s) for date (Composition editing time) - * - *

- * Definition: - * The composition editing time, when the composition was last logically changed by the author - *

- */ - public Composition setDate(DateTimeDt theValue) { - myDate = theValue; - return this; - } - - /** - * Sets the value for date (Composition editing time) - * - *

- * Definition: - * The composition editing time, when the composition was last logically changed by the author - *

- */ - public Composition setDateWithSecondsPrecision( Date theDate) { - myDate = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for date (Composition editing time) - * - *

- * Definition: - * The composition editing time, when the composition was last logically changed by the author - *

- */ - public Composition setDate( Date theDate, TemporalPrecisionEnum thePrecision) { - myDate = new DateTimeDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for type (Kind of composition (LOINC if possible)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition - *

- */ - public CodeableConceptDt getType() { - if (myType == null) { - myType = new CodeableConceptDt(); - } - return myType; - } - - /** - * Sets the value(s) for type (Kind of composition (LOINC if possible)) - * - *

- * Definition: - * Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition - *

- */ - public Composition setType(CodeableConceptDt theValue) { - myType = theValue; - return this; - } - - - /** - * Gets the value(s) for class (Categorization of Composition). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A categorization for the type of the composition. This may be implied by or derived from the code specified in the Composition Type - *

- */ - public CodeableConceptDt getClassElement() { - if (myClassElement == null) { - myClassElement = new CodeableConceptDt(); - } - return myClassElement; - } - - /** - * Sets the value(s) for class (Categorization of Composition) - * - *

- * Definition: - * A categorization for the type of the composition. This may be implied by or derived from the code specified in the Composition Type - *

- */ - public Composition setClassElement(CodeableConceptDt theValue) { - myClassElement = theValue; - return this; - } - - - /** - * Gets the value(s) for title (Human Readable name/title). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Official human-readable label for the composition - *

- */ - public StringDt getTitle() { - if (myTitle == null) { - myTitle = new StringDt(); - } - return myTitle; - } - - /** - * Sets the value(s) for title (Human Readable name/title) - * - *

- * Definition: - * Official human-readable label for the composition - *

- */ - public Composition setTitle(StringDt theValue) { - myTitle = theValue; - return this; - } - - /** - * Sets the value for title (Human Readable name/title) - * - *

- * Definition: - * Official human-readable label for the composition - *

- */ - public Composition setTitle( String theString) { - myTitle = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for status (preliminary | final | appended | amended | entered in error). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document - *

- */ - public BoundCodeDt getStatus() { - if (myStatus == null) { - myStatus = new BoundCodeDt(CompositionStatusEnum.VALUESET_BINDER); - } - return myStatus; - } - - /** - * Sets the value(s) for status (preliminary | final | appended | amended | entered in error) - * - *

- * Definition: - * The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document - *

- */ - public Composition setStatus(BoundCodeDt theValue) { - myStatus = theValue; - return this; - } - - /** - * Sets the value(s) for status (preliminary | final | appended | amended | entered in error) - * - *

- * Definition: - * The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document - *

- */ - public Composition setStatus(CompositionStatusEnum theValue) { - getStatus().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for confidentiality (As defined by affinity domain). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The code specifying the level of confidentiality of the Composition - *

- */ - public CodingDt getConfidentiality() { - if (myConfidentiality == null) { - myConfidentiality = new CodingDt(); - } - return myConfidentiality; - } - - /** - * Sets the value(s) for confidentiality (As defined by affinity domain) - * - *

- * Definition: - * The code specifying the level of confidentiality of the Composition - *

- */ - public Composition setConfidentiality(CodingDt theValue) { - myConfidentiality = theValue; - return this; - } - - - /** - * Gets the value(s) for subject (Who and/or what the composition is about). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure) - *

- */ - public ResourceReferenceDt getSubject() { - if (mySubject == null) { - mySubject = new ResourceReferenceDt(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (Who and/or what the composition is about) - * - *

- * Definition: - * Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure) - *

- */ - public Composition setSubject(ResourceReferenceDt theValue) { - mySubject = theValue; - return this; - } - - - /** - * Gets the value(s) for author (Who and/or what authored the composition). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.) - *

- */ - public java.util.List getAuthor() { - if (myAuthor == null) { - myAuthor = new java.util.ArrayList(); - } - return myAuthor; - } - - /** - * Sets the value(s) for author (Who and/or what authored the composition) - * - *

- * Definition: - * Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.) - *

- */ - public Composition setAuthor(java.util.List theValue) { - myAuthor = theValue; - return this; - } - - /** - * Adds and returns a new value for author (Who and/or what authored the composition) - * - *

- * Definition: - * Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.) - *

- */ - public ResourceReferenceDt addAuthor() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getAuthor().add(newType); - return newType; - } - - /** - * Gets the value(s) for attester (Attests to accuracy of composition). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A participant who has attested to the accuracy of the composition/document - *

- */ - public java.util.List getAttester() { - if (myAttester == null) { - myAttester = new java.util.ArrayList(); - } - return myAttester; - } - - /** - * Sets the value(s) for attester (Attests to accuracy of composition) - * - *

- * Definition: - * A participant who has attested to the accuracy of the composition/document - *

- */ - public Composition setAttester(java.util.List theValue) { - myAttester = theValue; - return this; - } - - /** - * Adds and returns a new value for attester (Attests to accuracy of composition) - * - *

- * Definition: - * A participant who has attested to the accuracy of the composition/document - *

- */ - public Attester addAttester() { - Attester newType = new Attester(); - getAttester().add(newType); - return newType; - } - - /** - * Gets the first repetition for attester (Attests to accuracy of composition), - * creating it if it does not already exist. - * - *

- * Definition: - * A participant who has attested to the accuracy of the composition/document - *

- */ - public Attester getAttesterFirstRep() { - if (getAttester().isEmpty()) { - return addAttester(); - } - return getAttester().get(0); - } - - /** - * Gets the value(s) for custodian (Org which maintains the composition). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information - *

- */ - public ResourceReferenceDt getCustodian() { - if (myCustodian == null) { - myCustodian = new ResourceReferenceDt(); - } - return myCustodian; - } - - /** - * Sets the value(s) for custodian (Org which maintains the composition) - * - *

- * Definition: - * Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information - *

- */ - public Composition setCustodian(ResourceReferenceDt theValue) { - myCustodian = theValue; - return this; - } - - - /** - * Gets the value(s) for event (The clinical event/act/item being documented). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The main event/act/item, such as a colonoscopy or an appendectomy, being documented - *

- */ - public Event getEvent() { - if (myEvent == null) { - myEvent = new Event(); - } - return myEvent; - } - - /** - * Sets the value(s) for event (The clinical event/act/item being documented) - * - *

- * Definition: - * The main event/act/item, such as a colonoscopy or an appendectomy, being documented - *

- */ - public Composition setEvent(Event theValue) { - myEvent = theValue; - return this; - } - - - /** - * Gets the value(s) for encounter (Context of the conposition). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Describes the clinical encounter or type of care this documentation is associated with. - *

- */ - public ResourceReferenceDt getEncounter() { - if (myEncounter == null) { - myEncounter = new ResourceReferenceDt(); - } - return myEncounter; - } - - /** - * Sets the value(s) for encounter (Context of the conposition) - * - *

- * Definition: - * Describes the clinical encounter or type of care this documentation is associated with. - *

- */ - public Composition setEncounter(ResourceReferenceDt theValue) { - myEncounter = theValue; - return this; - } - - - /** - * Gets the value(s) for section (Composition is broken into sections). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The root of the sections that make up the composition - *

- */ - public java.util.List
getSection() { - if (mySection == null) { - mySection = new java.util.ArrayList
(); - } - return mySection; - } - - /** - * Sets the value(s) for section (Composition is broken into sections) - * - *

- * Definition: - * The root of the sections that make up the composition - *

- */ - public Composition setSection(java.util.List
theValue) { - mySection = theValue; - return this; - } - - /** - * Adds and returns a new value for section (Composition is broken into sections) - * - *

- * Definition: - * The root of the sections that make up the composition - *

- */ - public Section addSection() { - Section newType = new Section(); - getSection().add(newType); - return newType; - } - - /** - * Gets the first repetition for section (Composition is broken into sections), - * creating it if it does not already exist. - * - *

- * Definition: - * The root of the sections that make up the composition - *

- */ - public Section getSectionFirstRep() { - if (getSection().isEmpty()) { - return addSection(); - } - return getSection().get(0); - } - - /** - * Block class for child element: Composition.attester (Attests to accuracy of composition) - * - *

- * Definition: - * A participant who has attested to the accuracy of the composition/document - *

- */ - @Block() - public static class Attester extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="mode", type=CodeDt.class, order=0, min=1, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="personal | professional | legal | official", - formalDefinition="The type of attestation the authenticator offers" - ) - private java.util.List> myMode; - - @Child(name="time", type=DateTimeDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="When composition attested", - formalDefinition="When composition was attested by the party" - ) - private DateTimeDt myTime; - - @Child(name="party", order=2, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Organization.class }) - @Description( - shortDefinition="Who attested the composition", - formalDefinition="Who attested the composition in the specified way" - ) - private ResourceReferenceDt myParty; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myMode, myTime, myParty); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myMode, myTime, myParty); - } - - /** - * Gets the value(s) for mode (personal | professional | legal | official). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The type of attestation the authenticator offers - *

- */ - public java.util.List> getMode() { - if (myMode == null) { - myMode = new java.util.ArrayList>(); - } - return myMode; - } - - /** - * Sets the value(s) for mode (personal | professional | legal | official) - * - *

- * Definition: - * The type of attestation the authenticator offers - *

- */ - public Attester setMode(java.util.List> theValue) { - myMode = theValue; - return this; - } - - /** - * Add a value for mode (personal | professional | legal | official) 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: - * The type of attestation the authenticator offers - *

- */ - public BoundCodeDt addMode(CompositionAttestationModeEnum theValue) { - BoundCodeDt retVal = new BoundCodeDt(CompositionAttestationModeEnum.VALUESET_BINDER, theValue); - getMode().add(retVal); - return retVal; - } - - /** - * Gets the first repetition for mode (personal | professional | legal | official), - * creating it if it does not already exist. - * - *

- * Definition: - * The type of attestation the authenticator offers - *

- */ - public BoundCodeDt getModeFirstRep() { - if (getMode().size() == 0) { - addMode(); - } - return getMode().get(0); - } - - /** - * Add a value for mode (personal | professional | legal | official) - * - *

- * Definition: - * The type of attestation the authenticator offers - *

- */ - public BoundCodeDt addMode() { - BoundCodeDt retVal = new BoundCodeDt(CompositionAttestationModeEnum.VALUESET_BINDER); - getMode().add(retVal); - return retVal; - } - - /** - * Sets the value(s), and clears any existing value(s) for mode (personal | professional | legal | official) - * - *

- * Definition: - * The type of attestation the authenticator offers - *

- */ - public Attester setMode(CompositionAttestationModeEnum theValue) { - getMode().clear(); - addMode(theValue); - return this; - } - - - /** - * Gets the value(s) for time (When composition attested). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * When composition was attested by the party - *

- */ - public DateTimeDt getTime() { - if (myTime == null) { - myTime = new DateTimeDt(); - } - return myTime; - } - - /** - * Sets the value(s) for time (When composition attested) - * - *

- * Definition: - * When composition was attested by the party - *

- */ - public Attester setTime(DateTimeDt theValue) { - myTime = theValue; - return this; - } - - /** - * Sets the value for time (When composition attested) - * - *

- * Definition: - * When composition was attested by the party - *

- */ - public Attester setTimeWithSecondsPrecision( Date theDate) { - myTime = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for time (When composition attested) - * - *

- * Definition: - * When composition was attested by the party - *

- */ - public Attester setTime( Date theDate, TemporalPrecisionEnum thePrecision) { - myTime = new DateTimeDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for party (Who attested the composition). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Who attested the composition in the specified way - *

- */ - public ResourceReferenceDt getParty() { - if (myParty == null) { - myParty = new ResourceReferenceDt(); - } - return myParty; - } - - /** - * Sets the value(s) for party (Who attested the composition) - * - *

- * Definition: - * Who attested the composition in the specified way - *

- */ - public Attester setParty(ResourceReferenceDt theValue) { - myParty = theValue; - return this; - } - - - - } - - - /** - * Block class for child element: Composition.event (The clinical event/act/item being documented) - * - *

- * Definition: - * The main event/act/item, such as a colonoscopy or an appendectomy, being documented - *

- */ - @Block() - public static class Event extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="code", type=CodeableConceptDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Code(s) that apply to the event being documented", - formalDefinition="This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a \"History and Physical Report\" in which the procedure being documented is necessarily a \"History and Physical\" act." - ) - private java.util.List myCode; - - @Child(name="period", type=PeriodDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="The period covered by the documentation", - formalDefinition="The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time" - ) - private PeriodDt myPeriod; - - @Child(name="detail", order=2, min=0, max=Child.MAX_UNLIMITED, type={ - IResource.class }) - @Description( - shortDefinition="Full details for the event(s) the composition consents", - formalDefinition="Full details for the event(s) the composition/documentation consents" - ) - private java.util.List myDetail; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCode, myPeriod, myDetail); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCode, myPeriod, myDetail); - } - - /** - * Gets the value(s) for code (Code(s) that apply to the event being documented). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a \"History and Physical Report\" in which the procedure being documented is necessarily a \"History and Physical\" act. - *

- */ - public java.util.List getCode() { - if (myCode == null) { - myCode = new java.util.ArrayList(); - } - return myCode; - } - - /** - * Sets the value(s) for code (Code(s) that apply to the event being documented) - * - *

- * Definition: - * This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a \"History and Physical Report\" in which the procedure being documented is necessarily a \"History and Physical\" act. - *

- */ - public Event setCode(java.util.List theValue) { - myCode = theValue; - return this; - } - - /** - * Adds and returns a new value for code (Code(s) that apply to the event being documented) - * - *

- * Definition: - * This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a \"History and Physical Report\" in which the procedure being documented is necessarily a \"History and Physical\" act. - *

- */ - public CodeableConceptDt addCode() { - CodeableConceptDt newType = new CodeableConceptDt(); - getCode().add(newType); - return newType; - } - - /** - * Gets the first repetition for code (Code(s) that apply to the event being documented), - * creating it if it does not already exist. - * - *

- * Definition: - * This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a \"History and Physical Report\" in which the procedure being documented is necessarily a \"History and Physical\" act. - *

- */ - public CodeableConceptDt getCodeFirstRep() { - if (getCode().isEmpty()) { - return addCode(); - } - return getCode().get(0); - } - - /** - * Gets the value(s) for period (The period covered by the documentation). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time - *

- */ - public PeriodDt getPeriod() { - if (myPeriod == null) { - myPeriod = new PeriodDt(); - } - return myPeriod; - } - - /** - * Sets the value(s) for period (The period covered by the documentation) - * - *

- * Definition: - * The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time - *

- */ - public Event setPeriod(PeriodDt theValue) { - myPeriod = theValue; - return this; - } - - - /** - * Gets the value(s) for detail (Full details for the event(s) the composition consents). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Full details for the event(s) the composition/documentation consents - *

- */ - public java.util.List getDetail() { - if (myDetail == null) { - myDetail = new java.util.ArrayList(); - } - return myDetail; - } - - /** - * Sets the value(s) for detail (Full details for the event(s) the composition consents) - * - *

- * Definition: - * Full details for the event(s) the composition/documentation consents - *

- */ - public Event setDetail(java.util.List theValue) { - myDetail = theValue; - return this; - } - - /** - * Adds and returns a new value for detail (Full details for the event(s) the composition consents) - * - *

- * Definition: - * Full details for the event(s) the composition/documentation consents - *

- */ - public ResourceReferenceDt addDetail() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getDetail().add(newType); - return newType; - } - - - } - - - /** - * Block class for child element: Composition.section (Composition is broken into sections) - * - *

- * Definition: - * The root of the sections that make up the composition - *

- */ - @Block() - public static class Section extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="title", type=StringDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Label for section", - formalDefinition="The heading for this particular section. This will be part of the rendered content for the document." - ) - private StringDt myTitle; - - @Child(name="code", type=CodeableConceptDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Classification of section (recommended)", - formalDefinition="A code identifying the kind of content contained within the section" - ) - private CodeableConceptDt myCode; - - @Child(name="subject", order=2, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.Group.class, ca.uhn.fhir.model.dstu.resource.Device.class }) - @Description( - shortDefinition="If section different to composition", - formalDefinition="Identifies the primary subject of the section." - ) - private ResourceReferenceDt mySubject; - - @Child(name="content", order=3, min=0, max=1, type={ - IResource.class }) - @Description( - shortDefinition="The actual data for the section", - formalDefinition="Identifies the discrete data that provides the content for the section." - ) - private ResourceReferenceDt myContent; - - @Child(name="section", type=Section.class, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Nested Section", - formalDefinition="A nested sub-section within this section" - ) - private java.util.List
mySection; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myTitle, myCode, mySubject, myContent, mySection); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myTitle, myCode, mySubject, myContent, mySection); - } - - /** - * Gets the value(s) for title (Label for section). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The heading for this particular section. This will be part of the rendered content for the document. - *

- */ - public StringDt getTitle() { - if (myTitle == null) { - myTitle = new StringDt(); - } - return myTitle; - } - - /** - * Sets the value(s) for title (Label for section) - * - *

- * Definition: - * The heading for this particular section. This will be part of the rendered content for the document. - *

- */ - public Section setTitle(StringDt theValue) { - myTitle = theValue; - return this; - } - - /** - * Sets the value for title (Label for section) - * - *

- * Definition: - * The heading for this particular section. This will be part of the rendered content for the document. - *

- */ - public Section setTitle( String theString) { - myTitle = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for code (Classification of section (recommended)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A code identifying the kind of content contained within the section - *

- */ - public CodeableConceptDt getCode() { - if (myCode == null) { - myCode = new CodeableConceptDt(); - } - return myCode; - } - - /** - * Sets the value(s) for code (Classification of section (recommended)) - * - *

- * Definition: - * A code identifying the kind of content contained within the section - *

- */ - public Section setCode(CodeableConceptDt theValue) { - myCode = theValue; - return this; - } - - - /** - * Gets the value(s) for subject (If section different to composition). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the primary subject of the section. - *

- */ - public ResourceReferenceDt getSubject() { - if (mySubject == null) { - mySubject = new ResourceReferenceDt(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (If section different to composition) - * - *

- * Definition: - * Identifies the primary subject of the section. - *

- */ - public Section setSubject(ResourceReferenceDt theValue) { - mySubject = theValue; - return this; - } - - - /** - * Gets the value(s) for content (The actual data for the section). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the discrete data that provides the content for the section. - *

- */ - public ResourceReferenceDt getContent() { - if (myContent == null) { - myContent = new ResourceReferenceDt(); - } - return myContent; - } - - /** - * Sets the value(s) for content (The actual data for the section) - * - *

- * Definition: - * Identifies the discrete data that provides the content for the section. - *

- */ - public Section setContent(ResourceReferenceDt theValue) { - myContent = theValue; - return this; - } - - - /** - * Gets the value(s) for section (Nested Section). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A nested sub-section within this section - *

- */ - public java.util.List
getSection() { - if (mySection == null) { - mySection = new java.util.ArrayList
(); - } - return mySection; - } - - /** - * Sets the value(s) for section (Nested Section) - * - *

- * Definition: - * A nested sub-section within this section - *

- */ - public Section setSection(java.util.List
theValue) { - mySection = theValue; - return this; - } - - /** - * Adds and returns a new value for section (Nested Section) - * - *

- * Definition: - * A nested sub-section within this section - *

- */ - public Section addSection() { - Section newType = new Section(); - getSection().add(newType); - return newType; - } - - /** - * Gets the first repetition for section (Nested Section), - * creating it if it does not already exist. - * - *

- * Definition: - * A nested sub-section within this section - *

- */ - public Section getSectionFirstRep() { - if (getSection().isEmpty()) { - return addSection(); - } - return getSection().get(0); - } - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ConceptMap.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ConceptMap.java deleted file mode 100644 index 78d7b84e1c1..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ConceptMap.java +++ /dev/null @@ -1,1831 +0,0 @@ - - - - - - - - - - - - - - - - -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.dstu.composite.ContactDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.ConceptMapEquivalenceEnum; -import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; -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.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 ConceptMap Resource - * (A statement of relationships from one set of concepts to one or more other concept systems) - * - *

- * Definition: - * A statement of relationships from one set of concepts to one or more other concept systems - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/ConceptMap - *

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

- * Description: The identifier of the concept map
- * Type: token
- * Path: ConceptMap.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="ConceptMap.identifier", description="The identifier of the concept map", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - - /** - * Fluent Client search parameter constant for identifier - *

- * Description: The identifier of the concept map
- * Type: token
- * Path: ConceptMap.identifier
- *

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

- * Description: The version identifier of the concept map
- * Type: token
- * Path: ConceptMap.version
- *

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

- * Description: The version identifier of the concept map
- * Type: token
- * Path: ConceptMap.version
- *

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

- * Description: Name of the concept map
- * Type: string
- * Path: ConceptMap.name
- *

- */ - @SearchParamDefinition(name="name", path="ConceptMap.name", description="Name of the concept map", type="string" ) - public static final String SP_NAME = "name"; - - /** - * Fluent Client search parameter constant for name - *

- * Description: Name of the concept map
- * Type: string
- * Path: ConceptMap.name
- *

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

- * Description: Name of the publisher of the concept map
- * Type: string
- * Path: ConceptMap.publisher
- *

- */ - @SearchParamDefinition(name="publisher", path="ConceptMap.publisher", description="Name of the publisher of the concept map", type="string" ) - public static final String SP_PUBLISHER = "publisher"; - - /** - * Fluent Client search parameter constant for publisher - *

- * Description: Name of the publisher of the concept map
- * Type: string
- * Path: ConceptMap.publisher
- *

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

- * Description: Text search in the description of the concept map
- * Type: string
- * Path: ConceptMap.description
- *

- */ - @SearchParamDefinition(name="description", path="ConceptMap.description", description="Text search in the description of the concept map", type="string" ) - public static final String SP_DESCRIPTION = "description"; - - /** - * Fluent Client search parameter constant for description - *

- * Description: Text search in the description of the concept map
- * Type: string
- * Path: ConceptMap.description
- *

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

- * Description: Status of the concept map
- * Type: token
- * Path: ConceptMap.status
- *

- */ - @SearchParamDefinition(name="status", path="ConceptMap.status", description="Status of the concept map", type="token" ) - public static final String SP_STATUS = "status"; - - /** - * Fluent Client search parameter constant for status - *

- * Description: Status of the concept map
- * Type: token
- * Path: ConceptMap.status
- *

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

- * Description: The concept map publication date
- * Type: date
- * Path: ConceptMap.date
- *

- */ - @SearchParamDefinition(name="date", path="ConceptMap.date", description="The concept map publication date", type="date" ) - public static final String SP_DATE = "date"; - - /** - * Fluent Client search parameter constant for date - *

- * Description: The concept map publication date
- * Type: date
- * Path: ConceptMap.date
- *

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

- * Description: The system for any concepts mapped by this concept map
- * Type: reference
- * Path: ConceptMap.source
- *

- */ - @SearchParamDefinition(name="source", path="ConceptMap.source", description="The system for any concepts mapped by this concept map", type="reference" ) - public static final String SP_SOURCE = "source"; - - /** - * Fluent Client search parameter constant for source - *

- * Description: The system for any concepts mapped by this concept map
- * Type: reference
- * Path: ConceptMap.source
- *

- */ - public static final ReferenceClientParam SOURCE = new ReferenceClientParam(SP_SOURCE); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ConceptMap.source". - */ - public static final Include INCLUDE_SOURCE = new Include("ConceptMap.source"); - - /** - * Search parameter constant for target - *

- * Description:
- * Type: reference
- * Path: ConceptMap.target
- *

- */ - @SearchParamDefinition(name="target", path="ConceptMap.target", description="", type="reference" ) - public static final String SP_TARGET = "target"; - - /** - * Fluent Client search parameter constant for target - *

- * Description:
- * Type: reference
- * Path: ConceptMap.target
- *

- */ - public static final ReferenceClientParam TARGET = new ReferenceClientParam(SP_TARGET); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ConceptMap.target". - */ - public static final Include INCLUDE_TARGET = new Include("ConceptMap.target"); - - /** - * Search parameter constant for system - *

- * Description: The system for any destination concepts mapped by this map
- * Type: token
- * Path: ConceptMap.concept.map.system
- *

- */ - @SearchParamDefinition(name="system", path="ConceptMap.concept.map.system", description="The system for any destination concepts mapped by this map", type="token" ) - public static final String SP_SYSTEM = "system"; - - /** - * Fluent Client search parameter constant for system - *

- * Description: The system for any destination concepts mapped by this map
- * Type: token
- * Path: ConceptMap.concept.map.system
- *

- */ - public static final TokenClientParam SYSTEM = new TokenClientParam(SP_SYSTEM); - - /** - * Search parameter constant for dependson - *

- * Description:
- * Type: token
- * Path: ConceptMap.concept.dependsOn.concept
- *

- */ - @SearchParamDefinition(name="dependson", path="ConceptMap.concept.dependsOn.concept", description="", type="token" ) - public static final String SP_DEPENDSON = "dependson"; - - /** - * Fluent Client search parameter constant for dependson - *

- * Description:
- * Type: token
- * Path: ConceptMap.concept.dependsOn.concept
- *

- */ - public static final TokenClientParam DEPENDSON = new TokenClientParam(SP_DEPENDSON); - - /** - * Search parameter constant for product - *

- * Description:
- * Type: token
- * Path: ConceptMap.concept.map.product.concept
- *

- */ - @SearchParamDefinition(name="product", path="ConceptMap.concept.map.product.concept", description="", type="token" ) - public static final String SP_PRODUCT = "product"; - - /** - * Fluent Client search parameter constant for product - *

- * Description:
- * Type: token
- * Path: ConceptMap.concept.map.product.concept
- *

- */ - public static final TokenClientParam PRODUCT = new TokenClientParam(SP_PRODUCT); - - - @Child(name="identifier", type=StringDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Logical id to reference this concept map", - formalDefinition="The identifier that is used to identify this concept map 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 concept map", - formalDefinition="The identifier that is used to identify this version of the concept map 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 concept map", - formalDefinition="A free text natural language name describing the concept map" - ) - 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 concept map" - ) - 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=0, max=1) - @Description( - shortDefinition="Human language description of the concept map", - formalDefinition="A free text natural language description of the use of the concept map - 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 concept map or its content", - formalDefinition="A copyright statement relating to the concept map 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 concept map" - ) - 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 ConceptMap 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 given status", - formalDefinition="The date that the concept map status was last changed" - ) - private DateTimeDt myDate; - - @Child(name="source", order=10, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.ValueSet.class }) - @Description( - shortDefinition="Identifies the source value set which is being mapped", - formalDefinition="The source value set that specifies the concepts that are being mapped" - ) - private ResourceReferenceDt mySource; - - @Child(name="target", order=11, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.ValueSet.class }) - @Description( - shortDefinition="Provides context to the mappings", - formalDefinition="The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made" - ) - private ResourceReferenceDt myTarget; - - @Child(name="concept", order=12, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Mappings for a concept from the source valueset", - formalDefinition="" - ) - private java.util.List myConcept; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myVersion, myName, myPublisher, myTelecom, myDescription, myCopyright, myStatus, myExperimental, myDate, mySource, myTarget, myConcept); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myVersion, myName, myPublisher, myTelecom, myDescription, myCopyright, myStatus, myExperimental, myDate, mySource, myTarget, myConcept); - } - - /** - * Gets the value(s) for identifier (Logical id to reference this concept map). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The identifier that is used to identify this concept map 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 concept map) - * - *

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

- */ - public ConceptMap setIdentifier(StringDt theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Sets the value for identifier (Logical id to reference this concept map) - * - *

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

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

- * Definition: - * The identifier that is used to identify this version of the concept map 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 concept map) - * - *

- * Definition: - * The identifier that is used to identify this version of the concept map 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 ConceptMap setVersion(StringDt theValue) { - myVersion = theValue; - return this; - } - - /** - * Sets the value for version (Logical id for this version of the concept map) - * - *

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

- * Definition: - * A free text natural language name describing the concept map - *

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

- * Definition: - * A free text natural language name describing the concept map - *

- */ - public ConceptMap setName(StringDt theValue) { - myName = theValue; - return this; - } - - /** - * Sets the value for name (Informal name for this concept map) - * - *

- * Definition: - * A free text natural language name describing the concept map - *

- */ - public ConceptMap 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 concept map - *

- */ - 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 concept map - *

- */ - public ConceptMap 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 concept map - *

- */ - public ConceptMap 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 ConceptMap 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 ConceptMap 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 ConceptMap 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 concept map). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A free text natural language description of the use of the concept map - 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 concept map) - * - *

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

- */ - public ConceptMap setDescription(StringDt theValue) { - myDescription = theValue; - return this; - } - - /** - * Sets the value for description (Human language description of the concept map) - * - *

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

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

- * Definition: - * A copyright statement relating to the concept map and/or its contents - *

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

- * Definition: - * A copyright statement relating to the concept map and/or its contents - *

- */ - public ConceptMap setCopyright(StringDt theValue) { - myCopyright = theValue; - return this; - } - - /** - * Sets the value for copyright (About the concept map or its content) - * - *

- * Definition: - * A copyright statement relating to the concept map and/or its contents - *

- */ - public ConceptMap 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 concept map - *

- */ - 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 concept map - *

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

- * Definition: - * The status of the concept map - *

- */ - public ConceptMap 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 ConceptMap 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 ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage - *

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

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

- */ - public ConceptMap setExperimental( boolean theBoolean) { - myExperimental = 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 concept map 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 concept map status was last changed - *

- */ - public ConceptMap setDate(DateTimeDt theValue) { - myDate = theValue; - return this; - } - - /** - * Sets the value for date (Date for given status) - * - *

- * Definition: - * The date that the concept map status was last changed - *

- */ - public ConceptMap setDateWithSecondsPrecision( Date theDate) { - myDate = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for date (Date for given status) - * - *

- * Definition: - * The date that the concept map status was last changed - *

- */ - public ConceptMap setDate( Date theDate, TemporalPrecisionEnum thePrecision) { - myDate = new DateTimeDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for source (Identifies the source value set which is being mapped). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The source value set that specifies the concepts that are being mapped - *

- */ - public ResourceReferenceDt getSource() { - if (mySource == null) { - mySource = new ResourceReferenceDt(); - } - return mySource; - } - - /** - * Sets the value(s) for source (Identifies the source value set which is being mapped) - * - *

- * Definition: - * The source value set that specifies the concepts that are being mapped - *

- */ - public ConceptMap setSource(ResourceReferenceDt theValue) { - mySource = theValue; - return this; - } - - - /** - * Gets the value(s) for target (Provides context to the mappings). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made - *

- */ - public ResourceReferenceDt getTarget() { - if (myTarget == null) { - myTarget = new ResourceReferenceDt(); - } - return myTarget; - } - - /** - * Sets the value(s) for target (Provides context to the mappings) - * - *

- * Definition: - * The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made - *

- */ - public ConceptMap setTarget(ResourceReferenceDt theValue) { - myTarget = theValue; - return this; - } - - - /** - * Gets the value(s) for concept (Mappings for a concept from the source valueset). - * 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 (Mappings for a concept from the source valueset) - * - *

- * Definition: - * - *

- */ - public ConceptMap setConcept(java.util.List theValue) { - myConcept = theValue; - return this; - } - - /** - * Adds and returns a new value for concept (Mappings for a concept from the source valueset) - * - *

- * Definition: - * - *

- */ - public Concept addConcept() { - Concept newType = new Concept(); - getConcept().add(newType); - return newType; - } - - /** - * Gets the first repetition for concept (Mappings for a concept from the source valueset), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public Concept getConceptFirstRep() { - if (getConcept().isEmpty()) { - return addConcept(); - } - return getConcept().get(0); - } - - /** - * Block class for child element: ConceptMap.concept (Mappings for a concept from the source valueset) - * - *

- * Definition: - * - *

- */ - @Block() - public static class Concept extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="system", type=UriDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="System that defines the concept being mapped", - formalDefinition="" - ) - private UriDt mySystem; - - @Child(name="code", type=CodeDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Identifies concept being mapped", - formalDefinition="" - ) - private CodeDt myCode; - - @Child(name="dependsOn", order=2, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Other concepts required for this mapping (from context)", - formalDefinition="A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified concept can be resolved, and it has the specified value" - ) - private java.util.List myDependsOn; - - @Child(name="map", order=3, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="A concept from the target value set that this concept maps to", - formalDefinition="" - ) - private java.util.List myMap; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySystem, myCode, myDependsOn, myMap); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySystem, myCode, myDependsOn, myMap); - } - - /** - * Gets the value(s) for system (System that defines the concept being mapped). - * 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 that defines the concept being mapped) - * - *

- * Definition: - * - *

- */ - public Concept setSystem(UriDt theValue) { - mySystem = theValue; - return this; - } - - /** - * Sets the value for system (System that defines the concept being mapped) - * - *

- * Definition: - * - *

- */ - public Concept setSystem( String theUri) { - mySystem = new UriDt(theUri); - return this; - } - - - /** - * Gets the value(s) for code (Identifies concept being mapped). - * 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 (Identifies concept being mapped) - * - *

- * Definition: - * - *

- */ - public Concept setCode(CodeDt theValue) { - myCode = theValue; - return this; - } - - /** - * Sets the value for code (Identifies concept being mapped) - * - *

- * Definition: - * - *

- */ - public Concept setCode( String theCode) { - myCode = new CodeDt(theCode); - return this; - } - - - /** - * Gets the value(s) for dependsOn (Other concepts required for this mapping (from context)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified concept can be resolved, and it has the specified value - *

- */ - public java.util.List getDependsOn() { - if (myDependsOn == null) { - myDependsOn = new java.util.ArrayList(); - } - return myDependsOn; - } - - /** - * Sets the value(s) for dependsOn (Other concepts required for this mapping (from context)) - * - *

- * Definition: - * A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified concept can be resolved, and it has the specified value - *

- */ - public Concept setDependsOn(java.util.List theValue) { - myDependsOn = theValue; - return this; - } - - /** - * Adds and returns a new value for dependsOn (Other concepts required for this mapping (from context)) - * - *

- * Definition: - * A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified concept can be resolved, and it has the specified value - *

- */ - public ConceptDependsOn addDependsOn() { - ConceptDependsOn newType = new ConceptDependsOn(); - getDependsOn().add(newType); - return newType; - } - - /** - * Gets the first repetition for dependsOn (Other concepts required for this mapping (from context)), - * creating it if it does not already exist. - * - *

- * Definition: - * A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified concept can be resolved, and it has the specified value - *

- */ - public ConceptDependsOn getDependsOnFirstRep() { - if (getDependsOn().isEmpty()) { - return addDependsOn(); - } - return getDependsOn().get(0); - } - - /** - * Gets the value(s) for map (A concept from the target value set that this concept maps to). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getMap() { - if (myMap == null) { - myMap = new java.util.ArrayList(); - } - return myMap; - } - - /** - * Sets the value(s) for map (A concept from the target value set that this concept maps to) - * - *

- * Definition: - * - *

- */ - public Concept setMap(java.util.List theValue) { - myMap = theValue; - return this; - } - - /** - * Adds and returns a new value for map (A concept from the target value set that this concept maps to) - * - *

- * Definition: - * - *

- */ - public ConceptMap2 addMap() { - ConceptMap2 newType = new ConceptMap2(); - getMap().add(newType); - return newType; - } - - /** - * Gets the first repetition for map (A concept from the target value set that this concept maps to), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public ConceptMap2 getMapFirstRep() { - if (getMap().isEmpty()) { - return addMap(); - } - return getMap().get(0); - } - - - } - - /** - * Block class for child element: ConceptMap.concept.dependsOn (Other concepts required for this mapping (from context)) - * - *

- * Definition: - * A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified concept can be resolved, and it has the specified value - *

- */ - @Block() - public static class ConceptDependsOn extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="concept", type=UriDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Reference to element/field/valueset provides the context", - formalDefinition="A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition" - ) - private UriDt myConcept; - - @Child(name="system", type=UriDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="System for a concept in the referenced concept", - formalDefinition="" - ) - private UriDt mySystem; - - @Child(name="code", type=CodeDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="Code for a concept in the referenced concept", - formalDefinition="" - ) - private CodeDt myCode; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myConcept, mySystem, myCode); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myConcept, mySystem, myCode); - } - - /** - * Gets the value(s) for concept (Reference to element/field/valueset provides the context). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition - *

- */ - public UriDt getConcept() { - if (myConcept == null) { - myConcept = new UriDt(); - } - return myConcept; - } - - /** - * Sets the value(s) for concept (Reference to element/field/valueset provides the context) - * - *

- * Definition: - * A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition - *

- */ - public ConceptDependsOn setConcept(UriDt theValue) { - myConcept = theValue; - return this; - } - - /** - * Sets the value for concept (Reference to element/field/valueset provides the context) - * - *

- * Definition: - * A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition - *

- */ - public ConceptDependsOn setConcept( String theUri) { - myConcept = new UriDt(theUri); - return this; - } - - - /** - * Gets the value(s) for system (System for a concept in the referenced concept). - * 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 for a concept in the referenced concept) - * - *

- * Definition: - * - *

- */ - public ConceptDependsOn setSystem(UriDt theValue) { - mySystem = theValue; - return this; - } - - /** - * Sets the value for system (System for a concept in the referenced concept) - * - *

- * Definition: - * - *

- */ - public ConceptDependsOn setSystem( String theUri) { - mySystem = new UriDt(theUri); - return this; - } - - - /** - * Gets the value(s) for code (Code for a concept in the referenced 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 for a concept in the referenced concept) - * - *

- * Definition: - * - *

- */ - public ConceptDependsOn setCode(CodeDt theValue) { - myCode = theValue; - return this; - } - - /** - * Sets the value for code (Code for a concept in the referenced concept) - * - *

- * Definition: - * - *

- */ - public ConceptDependsOn setCode( String theCode) { - myCode = new CodeDt(theCode); - return this; - } - - - - } - - - /** - * Block class for child element: ConceptMap.concept.map (A concept from the target value set that this concept maps to) - * - *

- * Definition: - * - *

- */ - @Block() - public static class ConceptMap2 extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="system", type=UriDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="System of the target", - formalDefinition="" - ) - private UriDt mySystem; - - @Child(name="code", type=CodeDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Code that identifies the target concept", - formalDefinition="" - ) - private CodeDt myCode; - - @Child(name="equivalence", type=CodeDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="equal | equivalent | wider | subsumes | narrower | specialises | inexact | unmatched | disjoint", - formalDefinition="" - ) - private BoundCodeDt myEquivalence; - - @Child(name="comments", type=StringDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Description of status/issues in mapping", - formalDefinition="" - ) - private StringDt myComments; - - @Child(name="product", type=ConceptDependsOn.class, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Other concepts that this mapping also produces", - formalDefinition="A set of additional outcomes from this mapping to other value sets. To properly execute this mapping, the specified value set must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on" - ) - private java.util.List myProduct; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySystem, myCode, myEquivalence, myComments, myProduct); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySystem, myCode, myEquivalence, myComments, myProduct); - } - - /** - * Gets the value(s) for system (System of the target). - * 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 of the target) - * - *

- * Definition: - * - *

- */ - public ConceptMap2 setSystem(UriDt theValue) { - mySystem = theValue; - return this; - } - - /** - * Sets the value for system (System of the target) - * - *

- * Definition: - * - *

- */ - public ConceptMap2 setSystem( String theUri) { - mySystem = new UriDt(theUri); - return this; - } - - - /** - * Gets the value(s) for code (Code that identifies the target 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 the target concept) - * - *

- * Definition: - * - *

- */ - public ConceptMap2 setCode(CodeDt theValue) { - myCode = theValue; - return this; - } - - /** - * Sets the value for code (Code that identifies the target concept) - * - *

- * Definition: - * - *

- */ - public ConceptMap2 setCode( String theCode) { - myCode = new CodeDt(theCode); - return this; - } - - - /** - * Gets the value(s) for equivalence (equal | equivalent | wider | subsumes | narrower | specialises | inexact | unmatched | disjoint). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public BoundCodeDt getEquivalence() { - if (myEquivalence == null) { - myEquivalence = new BoundCodeDt(ConceptMapEquivalenceEnum.VALUESET_BINDER); - } - return myEquivalence; - } - - /** - * Sets the value(s) for equivalence (equal | equivalent | wider | subsumes | narrower | specialises | inexact | unmatched | disjoint) - * - *

- * Definition: - * - *

- */ - public ConceptMap2 setEquivalence(BoundCodeDt theValue) { - myEquivalence = theValue; - return this; - } - - /** - * Sets the value(s) for equivalence (equal | equivalent | wider | subsumes | narrower | specialises | inexact | unmatched | disjoint) - * - *

- * Definition: - * - *

- */ - public ConceptMap2 setEquivalence(ConceptMapEquivalenceEnum theValue) { - getEquivalence().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for comments (Description of status/issues in mapping). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public StringDt getComments() { - if (myComments == null) { - myComments = new StringDt(); - } - return myComments; - } - - /** - * Sets the value(s) for comments (Description of status/issues in mapping) - * - *

- * Definition: - * - *

- */ - public ConceptMap2 setComments(StringDt theValue) { - myComments = theValue; - return this; - } - - /** - * Sets the value for comments (Description of status/issues in mapping) - * - *

- * Definition: - * - *

- */ - public ConceptMap2 setComments( String theString) { - myComments = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for product (Other concepts that this mapping also produces). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A set of additional outcomes from this mapping to other value sets. To properly execute this mapping, the specified value set must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on - *

- */ - public java.util.List getProduct() { - if (myProduct == null) { - myProduct = new java.util.ArrayList(); - } - return myProduct; - } - - /** - * Sets the value(s) for product (Other concepts that this mapping also produces) - * - *

- * Definition: - * A set of additional outcomes from this mapping to other value sets. To properly execute this mapping, the specified value set must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on - *

- */ - public ConceptMap2 setProduct(java.util.List theValue) { - myProduct = theValue; - return this; - } - - /** - * Adds and returns a new value for product (Other concepts that this mapping also produces) - * - *

- * Definition: - * A set of additional outcomes from this mapping to other value sets. To properly execute this mapping, the specified value set must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on - *

- */ - public ConceptDependsOn addProduct() { - ConceptDependsOn newType = new ConceptDependsOn(); - getProduct().add(newType); - return newType; - } - - /** - * Gets the first repetition for product (Other concepts that this mapping also produces), - * creating it if it does not already exist. - * - *

- * Definition: - * A set of additional outcomes from this mapping to other value sets. To properly execute this mapping, the specified value set must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on - *

- */ - public ConceptDependsOn getProductFirstRep() { - if (getProduct().isEmpty()) { - return addProduct(); - } - return getProduct().get(0); - } - - - } - - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Condition.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Condition.java deleted file mode 100644 index f97e2e988e0..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Condition.java +++ /dev/null @@ -1,1778 +0,0 @@ - - - - - - - - - - - - - - - - -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.AgeDt; -import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.ConditionRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ConditionStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -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.DateDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.rest.gclient.DateClientParam; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR Condition Resource - * (Detailed information about conditions, problems or diagnoses) - * - *

- * Definition: - * Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a Diagnosis during an Encounter; populating a problem List or a Summary Statement, such as a Discharge Summary - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Condition - *

- * - */ -@ResourceDef(name="Condition", profile="http://hl7.org/fhir/profiles/Condition", id="condition") -public class Condition extends BaseResource implements IResource { - - /** - * Search parameter constant for code - *

- * Description: Code for the condition
- * Type: token
- * Path: Condition.code
- *

- */ - @SearchParamDefinition(name="code", path="Condition.code", description="Code for the condition", type="token" ) - public static final String SP_CODE = "code"; - - /** - * Fluent Client search parameter constant for code - *

- * Description: Code for the condition
- * Type: token
- * Path: Condition.code
- *

- */ - public static final TokenClientParam CODE = new TokenClientParam(SP_CODE); - - /** - * Search parameter constant for status - *

- * Description: The status of the condition
- * Type: token
- * Path: Condition.status
- *

- */ - @SearchParamDefinition(name="status", path="Condition.status", description="The status of the condition", type="token" ) - public static final String SP_STATUS = "status"; - - /** - * Fluent Client search parameter constant for status - *

- * Description: The status of the condition
- * Type: token
- * Path: Condition.status
- *

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

- * Description: The severity of the condition
- * Type: token
- * Path: Condition.severity
- *

- */ - @SearchParamDefinition(name="severity", path="Condition.severity", description="The severity of the condition", type="token" ) - public static final String SP_SEVERITY = "severity"; - - /** - * Fluent Client search parameter constant for severity - *

- * Description: The severity of the condition
- * Type: token
- * Path: Condition.severity
- *

- */ - public static final TokenClientParam SEVERITY = new TokenClientParam(SP_SEVERITY); - - /** - * Search parameter constant for category - *

- * Description: The category of the condition
- * Type: token
- * Path: Condition.category
- *

- */ - @SearchParamDefinition(name="category", path="Condition.category", description="The category of the condition", type="token" ) - public static final String SP_CATEGORY = "category"; - - /** - * Fluent Client search parameter constant for category - *

- * Description: The category of the condition
- * Type: token
- * Path: Condition.category
- *

- */ - public static final TokenClientParam CATEGORY = new TokenClientParam(SP_CATEGORY); - - /** - * Search parameter constant for onset - *

- * Description: When the Condition started (if started on a date)
- * Type: date
- * Path: Condition.onset[x]
- *

- */ - @SearchParamDefinition(name="onset", path="Condition.onset[x]", description="When the Condition started (if started on a date)", type="date" ) - public static final String SP_ONSET = "onset"; - - /** - * Fluent Client search parameter constant for onset - *

- * Description: When the Condition started (if started on a date)
- * Type: date
- * Path: Condition.onset[x]
- *

- */ - public static final DateClientParam ONSET = new DateClientParam(SP_ONSET); - - /** - * Search parameter constant for subject - *

- * Description:
- * Type: reference
- * Path: Condition.subject
- *

- */ - @SearchParamDefinition(name="subject", path="Condition.subject", description="", type="reference" ) - public static final String SP_SUBJECT = "subject"; - - /** - * Fluent Client search parameter constant for subject - *

- * Description:
- * Type: reference
- * Path: Condition.subject
- *

- */ - public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Condition.subject". - */ - public static final Include INCLUDE_SUBJECT = new Include("Condition.subject"); - - /** - * Search parameter constant for encounter - *

- * Description:
- * Type: reference
- * Path: Condition.encounter
- *

- */ - @SearchParamDefinition(name="encounter", path="Condition.encounter", description="", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - - /** - * Fluent Client search parameter constant for encounter - *

- * Description:
- * Type: reference
- * Path: Condition.encounter
- *

- */ - public static final ReferenceClientParam ENCOUNTER = new ReferenceClientParam(SP_ENCOUNTER); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Condition.encounter". - */ - public static final Include INCLUDE_ENCOUNTER = new Include("Condition.encounter"); - - /** - * Search parameter constant for asserter - *

- * Description:
- * Type: reference
- * Path: Condition.asserter
- *

- */ - @SearchParamDefinition(name="asserter", path="Condition.asserter", description="", type="reference" ) - public static final String SP_ASSERTER = "asserter"; - - /** - * Fluent Client search parameter constant for asserter - *

- * Description:
- * Type: reference
- * Path: Condition.asserter
- *

- */ - public static final ReferenceClientParam ASSERTER = new ReferenceClientParam(SP_ASSERTER); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Condition.asserter". - */ - public static final Include INCLUDE_ASSERTER = new Include("Condition.asserter"); - - /** - * Search parameter constant for date-asserted - *

- * Description:
- * Type: date
- * Path: Condition.dateAsserted
- *

- */ - @SearchParamDefinition(name="date-asserted", path="Condition.dateAsserted", description="", type="date" ) - public static final String SP_DATE_ASSERTED = "date-asserted"; - - /** - * Fluent Client search parameter constant for date-asserted - *

- * Description:
- * Type: date
- * Path: Condition.dateAsserted
- *

- */ - public static final DateClientParam DATE_ASSERTED = new DateClientParam(SP_DATE_ASSERTED); - - /** - * Search parameter constant for evidence - *

- * Description:
- * Type: token
- * Path: Condition.evidence.code
- *

- */ - @SearchParamDefinition(name="evidence", path="Condition.evidence.code", description="", type="token" ) - public static final String SP_EVIDENCE = "evidence"; - - /** - * Fluent Client search parameter constant for evidence - *

- * Description:
- * Type: token
- * Path: Condition.evidence.code
- *

- */ - public static final TokenClientParam EVIDENCE = new TokenClientParam(SP_EVIDENCE); - - /** - * Search parameter constant for location - *

- * Description:
- * Type: token
- * Path: Condition.location.code
- *

- */ - @SearchParamDefinition(name="location", path="Condition.location.code", description="", type="token" ) - public static final String SP_LOCATION = "location"; - - /** - * Fluent Client search parameter constant for location - *

- * Description:
- * Type: token
- * Path: Condition.location.code
- *

- */ - public static final TokenClientParam LOCATION = new TokenClientParam(SP_LOCATION); - - /** - * Search parameter constant for related-item - *

- * Description:
- * Type: reference
- * Path: Condition.relatedItem.target
- *

- */ - @SearchParamDefinition(name="related-item", path="Condition.relatedItem.target", description="", type="reference" ) - public static final String SP_RELATED_ITEM = "related-item"; - - /** - * Fluent Client search parameter constant for related-item - *

- * Description:
- * Type: reference
- * Path: Condition.relatedItem.target
- *

- */ - public static final ReferenceClientParam RELATED_ITEM = new ReferenceClientParam(SP_RELATED_ITEM); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Condition.relatedItem.target". - */ - public static final Include INCLUDE_RELATEDITEM_TARGET = new Include("Condition.relatedItem.target"); - - /** - * Search parameter constant for stage - *

- * Description:
- * Type: token
- * Path: Condition.stage.summary
- *

- */ - @SearchParamDefinition(name="stage", path="Condition.stage.summary", description="", type="token" ) - public static final String SP_STAGE = "stage"; - - /** - * Fluent Client search parameter constant for stage - *

- * Description:
- * Type: token
- * Path: Condition.stage.summary
- *

- */ - public static final TokenClientParam STAGE = new TokenClientParam(SP_STAGE); - - /** - * Search parameter constant for related-code - *

- * Description:
- * Type: token
- * Path: Condition.relatedItem.code
- *

- */ - @SearchParamDefinition(name="related-code", path="Condition.relatedItem.code", description="", type="token" ) - public static final String SP_RELATED_CODE = "related-code"; - - /** - * Fluent Client search parameter constant for related-code - *

- * Description:
- * Type: token
- * Path: Condition.relatedItem.code
- *

- */ - public static final TokenClientParam RELATED_CODE = new TokenClientParam(SP_RELATED_CODE); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="External Ids for this condition", - formalDefinition="This records identifiers associated with this condition that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)" - ) - private java.util.List myIdentifier; - - @Child(name="subject", order=1, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="Who has the condition?", - formalDefinition="Indicates the patient who the condition record is associated with" - ) - private ResourceReferenceDt mySubject; - - @Child(name="encounter", order=2, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Encounter.class }) - @Description( - shortDefinition="Encounter when condition first asserted", - formalDefinition="Encounter during which the condition was first asserted" - ) - private ResourceReferenceDt myEncounter; - - @Child(name="asserter", order=3, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="Person who asserts this condition", - formalDefinition="Person who takes responsibility for asserting the existence of the condition as part of the electronic record" - ) - private ResourceReferenceDt myAsserter; - - @Child(name="dateAsserted", type=DateDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="When first detected/suspected/entered", - formalDefinition="Estimated or actual date the condition/problem/diagnosis was first detected/suspected" - ) - private DateDt myDateAsserted; - - @Child(name="code", type=CodeableConceptDt.class, order=5, min=1, max=1) - @Description( - shortDefinition="Identification of the condition, problem or diagnosis", - formalDefinition="Identification of the condition, problem or diagnosis." - ) - private CodeableConceptDt myCode; - - @Child(name="category", type=CodeableConceptDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="E.g. complaint | symptom | finding | diagnosis", - formalDefinition="A category assigned to the condition. E.g. complaint | symptom | finding | diagnosis" - ) - private CodeableConceptDt myCategory; - - @Child(name="status", type=CodeDt.class, order=7, min=1, max=1) - @Description( - shortDefinition="provisional | working | confirmed | refuted", - formalDefinition="The clinical status of the condition" - ) - private BoundCodeDt myStatus; - - @Child(name="certainty", type=CodeableConceptDt.class, order=8, min=0, max=1) - @Description( - shortDefinition="Degree of confidence", - formalDefinition="The degree of confidence that this condition is correct" - ) - private CodeableConceptDt myCertainty; - - @Child(name="severity", type=CodeableConceptDt.class, order=9, min=0, max=1) - @Description( - shortDefinition="Subjective severity of condition", - formalDefinition="A subjective assessment of the severity of the condition as evaluated by the clinician." - ) - private CodeableConceptDt mySeverity; - - @Child(name="onset", order=10, min=0, max=1, type={ - DateDt.class, AgeDt.class }) - @Description( - shortDefinition="Estimated or actual date, or age", - formalDefinition="Estimated or actual date the condition began, in the opinion of the clinician" - ) - private IDatatype myOnset; - - @Child(name="abatement", order=11, min=0, max=1, type={ - DateDt.class, AgeDt.class, BooleanDt.class }) - @Description( - shortDefinition="If/when in resolution/remission", - formalDefinition="The date or estimated date that the condition resolved or went into remission. This is called \"abatement\" because of the many overloaded connotations associated with \"remission\" or \"resolution\" - Conditions are never really resolved, but they can abate." - ) - private IDatatype myAbatement; - - @Child(name="stage", order=12, min=0, max=1) - @Description( - shortDefinition="Stage/grade, usually assessed formally", - formalDefinition="Clinical stage or grade of a condition. May include formal severity assessments" - ) - private Stage myStage; - - @Child(name="evidence", order=13, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Supporting evidence", - formalDefinition="Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed" - ) - private java.util.List myEvidence; - - @Child(name="location", order=14, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Anatomical location, if relevant", - formalDefinition="The anatomical location where this condition manifests itself" - ) - private java.util.List myLocation; - - @Child(name="relatedItem", order=15, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Causes or precedents for this Condition", - formalDefinition="Further conditions, problems, diagnoses, procedures or events that are related in some way to this condition, or the substance that caused/triggered this Condition" - ) - private java.util.List myRelatedItem; - - @Child(name="notes", type=StringDt.class, order=16, min=0, max=1) - @Description( - shortDefinition="Additional information about the Condition", - formalDefinition="Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis" - ) - private StringDt myNotes; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, mySubject, myEncounter, myAsserter, myDateAsserted, myCode, myCategory, myStatus, myCertainty, mySeverity, myOnset, myAbatement, myStage, myEvidence, myLocation, myRelatedItem, myNotes); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, mySubject, myEncounter, myAsserter, myDateAsserted, myCode, myCategory, myStatus, myCertainty, mySeverity, myOnset, myAbatement, myStage, myEvidence, myLocation, myRelatedItem, myNotes); - } - - /** - * Gets the value(s) for identifier (External Ids for this condition). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * This records identifiers associated with this condition that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (External Ids for this condition) - * - *

- * Definition: - * This records identifiers associated with this condition that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public Condition setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (External Ids for this condition) - * - *

- * Definition: - * This records identifiers associated with this condition that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (External Ids for this condition), - * creating it if it does not already exist. - * - *

- * Definition: - * This records identifiers associated with this condition that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (External Ids for this condition) - * - *

- * Definition: - * This records identifiers associated with this condition that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Condition addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (External Ids for this condition) - * - *

- * Definition: - * This records identifiers associated with this condition that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Condition addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for subject (Who has the condition?). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates the patient who the condition record is associated with - *

- */ - public ResourceReferenceDt getSubject() { - if (mySubject == null) { - mySubject = new ResourceReferenceDt(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (Who has the condition?) - * - *

- * Definition: - * Indicates the patient who the condition record is associated with - *

- */ - public Condition setSubject(ResourceReferenceDt theValue) { - mySubject = theValue; - return this; - } - - - /** - * Gets the value(s) for encounter (Encounter when condition first asserted). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Encounter during which the condition was first asserted - *

- */ - public ResourceReferenceDt getEncounter() { - if (myEncounter == null) { - myEncounter = new ResourceReferenceDt(); - } - return myEncounter; - } - - /** - * Sets the value(s) for encounter (Encounter when condition first asserted) - * - *

- * Definition: - * Encounter during which the condition was first asserted - *

- */ - public Condition setEncounter(ResourceReferenceDt theValue) { - myEncounter = theValue; - return this; - } - - - /** - * Gets the value(s) for asserter (Person who asserts this condition). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Person who takes responsibility for asserting the existence of the condition as part of the electronic record - *

- */ - public ResourceReferenceDt getAsserter() { - if (myAsserter == null) { - myAsserter = new ResourceReferenceDt(); - } - return myAsserter; - } - - /** - * Sets the value(s) for asserter (Person who asserts this condition) - * - *

- * Definition: - * Person who takes responsibility for asserting the existence of the condition as part of the electronic record - *

- */ - public Condition setAsserter(ResourceReferenceDt theValue) { - myAsserter = theValue; - return this; - } - - - /** - * Gets the value(s) for dateAsserted (When first detected/suspected/entered). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Estimated or actual date the condition/problem/diagnosis was first detected/suspected - *

- */ - public DateDt getDateAsserted() { - if (myDateAsserted == null) { - myDateAsserted = new DateDt(); - } - return myDateAsserted; - } - - /** - * Sets the value(s) for dateAsserted (When first detected/suspected/entered) - * - *

- * Definition: - * Estimated or actual date the condition/problem/diagnosis was first detected/suspected - *

- */ - public Condition setDateAsserted(DateDt theValue) { - myDateAsserted = theValue; - return this; - } - - /** - * Sets the value for dateAsserted (When first detected/suspected/entered) - * - *

- * Definition: - * Estimated or actual date the condition/problem/diagnosis was first detected/suspected - *

- */ - public Condition setDateAssertedWithDayPrecision( Date theDate) { - myDateAsserted = new DateDt(theDate); - return this; - } - - /** - * Sets the value for dateAsserted (When first detected/suspected/entered) - * - *

- * Definition: - * Estimated or actual date the condition/problem/diagnosis was first detected/suspected - *

- */ - public Condition setDateAsserted( Date theDate, TemporalPrecisionEnum thePrecision) { - myDateAsserted = new DateDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for code (Identification of the condition, problem or diagnosis). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identification of the condition, problem or diagnosis. - *

- */ - public CodeableConceptDt getCode() { - if (myCode == null) { - myCode = new CodeableConceptDt(); - } - return myCode; - } - - /** - * Sets the value(s) for code (Identification of the condition, problem or diagnosis) - * - *

- * Definition: - * Identification of the condition, problem or diagnosis. - *

- */ - public Condition setCode(CodeableConceptDt theValue) { - myCode = theValue; - return this; - } - - - /** - * Gets the value(s) for category (E.g. complaint | symptom | finding | diagnosis). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A category assigned to the condition. E.g. complaint | symptom | finding | diagnosis - *

- */ - public CodeableConceptDt getCategory() { - if (myCategory == null) { - myCategory = new CodeableConceptDt(); - } - return myCategory; - } - - /** - * Sets the value(s) for category (E.g. complaint | symptom | finding | diagnosis) - * - *

- * Definition: - * A category assigned to the condition. E.g. complaint | symptom | finding | diagnosis - *

- */ - public Condition setCategory(CodeableConceptDt theValue) { - myCategory = theValue; - return this; - } - - - /** - * Gets the value(s) for status (provisional | working | confirmed | refuted). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The clinical status of the condition - *

- */ - public BoundCodeDt getStatus() { - if (myStatus == null) { - myStatus = new BoundCodeDt(ConditionStatusEnum.VALUESET_BINDER); - } - return myStatus; - } - - /** - * Sets the value(s) for status (provisional | working | confirmed | refuted) - * - *

- * Definition: - * The clinical status of the condition - *

- */ - public Condition setStatus(BoundCodeDt theValue) { - myStatus = theValue; - return this; - } - - /** - * Sets the value(s) for status (provisional | working | confirmed | refuted) - * - *

- * Definition: - * The clinical status of the condition - *

- */ - public Condition setStatus(ConditionStatusEnum theValue) { - getStatus().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for certainty (Degree of confidence). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The degree of confidence that this condition is correct - *

- */ - public CodeableConceptDt getCertainty() { - if (myCertainty == null) { - myCertainty = new CodeableConceptDt(); - } - return myCertainty; - } - - /** - * Sets the value(s) for certainty (Degree of confidence) - * - *

- * Definition: - * The degree of confidence that this condition is correct - *

- */ - public Condition setCertainty(CodeableConceptDt theValue) { - myCertainty = theValue; - return this; - } - - - /** - * Gets the value(s) for severity (Subjective severity of condition). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A subjective assessment of the severity of the condition as evaluated by the clinician. - *

- */ - public CodeableConceptDt getSeverity() { - if (mySeverity == null) { - mySeverity = new CodeableConceptDt(); - } - return mySeverity; - } - - /** - * Sets the value(s) for severity (Subjective severity of condition) - * - *

- * Definition: - * A subjective assessment of the severity of the condition as evaluated by the clinician. - *

- */ - public Condition setSeverity(CodeableConceptDt theValue) { - mySeverity = theValue; - return this; - } - - - /** - * Gets the value(s) for onset[x] (Estimated or actual date, or age). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Estimated or actual date the condition began, in the opinion of the clinician - *

- */ - public IDatatype getOnset() { - return myOnset; - } - - /** - * Sets the value(s) for onset[x] (Estimated or actual date, or age) - * - *

- * Definition: - * Estimated or actual date the condition began, in the opinion of the clinician - *

- */ - public Condition setOnset(IDatatype theValue) { - myOnset = theValue; - return this; - } - - - /** - * Gets the value(s) for abatement[x] (If/when in resolution/remission). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The date or estimated date that the condition resolved or went into remission. This is called \"abatement\" because of the many overloaded connotations associated with \"remission\" or \"resolution\" - Conditions are never really resolved, but they can abate. - *

- */ - public IDatatype getAbatement() { - return myAbatement; - } - - /** - * Sets the value(s) for abatement[x] (If/when in resolution/remission) - * - *

- * Definition: - * The date or estimated date that the condition resolved or went into remission. This is called \"abatement\" because of the many overloaded connotations associated with \"remission\" or \"resolution\" - Conditions are never really resolved, but they can abate. - *

- */ - public Condition setAbatement(IDatatype theValue) { - myAbatement = theValue; - return this; - } - - - /** - * Gets the value(s) for stage (Stage/grade, usually assessed formally). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Clinical stage or grade of a condition. May include formal severity assessments - *

- */ - public Stage getStage() { - if (myStage == null) { - myStage = new Stage(); - } - return myStage; - } - - /** - * Sets the value(s) for stage (Stage/grade, usually assessed formally) - * - *

- * Definition: - * Clinical stage or grade of a condition. May include formal severity assessments - *

- */ - public Condition setStage(Stage theValue) { - myStage = theValue; - return this; - } - - - /** - * Gets the value(s) for evidence (Supporting evidence). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed - *

- */ - public java.util.List getEvidence() { - if (myEvidence == null) { - myEvidence = new java.util.ArrayList(); - } - return myEvidence; - } - - /** - * Sets the value(s) for evidence (Supporting evidence) - * - *

- * Definition: - * Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed - *

- */ - public Condition setEvidence(java.util.List theValue) { - myEvidence = theValue; - return this; - } - - /** - * Adds and returns a new value for evidence (Supporting evidence) - * - *

- * Definition: - * Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed - *

- */ - public Evidence addEvidence() { - Evidence newType = new Evidence(); - getEvidence().add(newType); - return newType; - } - - /** - * Gets the first repetition for evidence (Supporting evidence), - * creating it if it does not already exist. - * - *

- * Definition: - * Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed - *

- */ - public Evidence getEvidenceFirstRep() { - if (getEvidence().isEmpty()) { - return addEvidence(); - } - return getEvidence().get(0); - } - - /** - * Gets the value(s) for location (Anatomical location, if relevant). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The anatomical location where this condition manifests itself - *

- */ - public java.util.List getLocation() { - if (myLocation == null) { - myLocation = new java.util.ArrayList(); - } - return myLocation; - } - - /** - * Sets the value(s) for location (Anatomical location, if relevant) - * - *

- * Definition: - * The anatomical location where this condition manifests itself - *

- */ - public Condition setLocation(java.util.List theValue) { - myLocation = theValue; - return this; - } - - /** - * Adds and returns a new value for location (Anatomical location, if relevant) - * - *

- * Definition: - * The anatomical location where this condition manifests itself - *

- */ - public Location addLocation() { - Location newType = new Location(); - getLocation().add(newType); - return newType; - } - - /** - * Gets the first repetition for location (Anatomical location, if relevant), - * creating it if it does not already exist. - * - *

- * Definition: - * The anatomical location where this condition manifests itself - *

- */ - public Location getLocationFirstRep() { - if (getLocation().isEmpty()) { - return addLocation(); - } - return getLocation().get(0); - } - - /** - * Gets the value(s) for relatedItem (Causes or precedents for this Condition). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Further conditions, problems, diagnoses, procedures or events that are related in some way to this condition, or the substance that caused/triggered this Condition - *

- */ - public java.util.List getRelatedItem() { - if (myRelatedItem == null) { - myRelatedItem = new java.util.ArrayList(); - } - return myRelatedItem; - } - - /** - * Sets the value(s) for relatedItem (Causes or precedents for this Condition) - * - *

- * Definition: - * Further conditions, problems, diagnoses, procedures or events that are related in some way to this condition, or the substance that caused/triggered this Condition - *

- */ - public Condition setRelatedItem(java.util.List theValue) { - myRelatedItem = theValue; - return this; - } - - /** - * Adds and returns a new value for relatedItem (Causes or precedents for this Condition) - * - *

- * Definition: - * Further conditions, problems, diagnoses, procedures or events that are related in some way to this condition, or the substance that caused/triggered this Condition - *

- */ - public RelatedItem addRelatedItem() { - RelatedItem newType = new RelatedItem(); - getRelatedItem().add(newType); - return newType; - } - - /** - * Gets the first repetition for relatedItem (Causes or precedents for this Condition), - * creating it if it does not already exist. - * - *

- * Definition: - * Further conditions, problems, diagnoses, procedures or events that are related in some way to this condition, or the substance that caused/triggered this Condition - *

- */ - public RelatedItem getRelatedItemFirstRep() { - if (getRelatedItem().isEmpty()) { - return addRelatedItem(); - } - return getRelatedItem().get(0); - } - - /** - * Gets the value(s) for notes (Additional information about the Condition). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis - *

- */ - public StringDt getNotes() { - if (myNotes == null) { - myNotes = new StringDt(); - } - return myNotes; - } - - /** - * Sets the value(s) for notes (Additional information about the Condition) - * - *

- * Definition: - * Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis - *

- */ - public Condition setNotes(StringDt theValue) { - myNotes = theValue; - return this; - } - - /** - * Sets the value for notes (Additional information about the Condition) - * - *

- * Definition: - * Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis - *

- */ - public Condition setNotes( String theString) { - myNotes = new StringDt(theString); - return this; - } - - - /** - * Block class for child element: Condition.stage (Stage/grade, usually assessed formally) - * - *

- * Definition: - * Clinical stage or grade of a condition. May include formal severity assessments - *

- */ - @Block() - public static class Stage extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="summary", type=CodeableConceptDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Simple summary (disease specific)", - formalDefinition="A simple summary of the stage such as \"Stage 3\". The determination of the stage is disease-specific" - ) - private CodeableConceptDt mySummary; - - @Child(name="assessment", order=1, min=0, max=Child.MAX_UNLIMITED, type={ - IResource.class }) - @Description( - shortDefinition="Formal record of assessment", - formalDefinition="Reference to a formal record of the evidence on which the staging assessment is based" - ) - private java.util.List myAssessment; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySummary, myAssessment); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySummary, myAssessment); - } - - /** - * Gets the value(s) for summary (Simple summary (disease specific)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A simple summary of the stage such as \"Stage 3\". The determination of the stage is disease-specific - *

- */ - public CodeableConceptDt getSummary() { - if (mySummary == null) { - mySummary = new CodeableConceptDt(); - } - return mySummary; - } - - /** - * Sets the value(s) for summary (Simple summary (disease specific)) - * - *

- * Definition: - * A simple summary of the stage such as \"Stage 3\". The determination of the stage is disease-specific - *

- */ - public Stage setSummary(CodeableConceptDt theValue) { - mySummary = theValue; - return this; - } - - - /** - * Gets the value(s) for assessment (Formal record of assessment). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Reference to a formal record of the evidence on which the staging assessment is based - *

- */ - public java.util.List getAssessment() { - if (myAssessment == null) { - myAssessment = new java.util.ArrayList(); - } - return myAssessment; - } - - /** - * Sets the value(s) for assessment (Formal record of assessment) - * - *

- * Definition: - * Reference to a formal record of the evidence on which the staging assessment is based - *

- */ - public Stage setAssessment(java.util.List theValue) { - myAssessment = theValue; - return this; - } - - /** - * Adds and returns a new value for assessment (Formal record of assessment) - * - *

- * Definition: - * Reference to a formal record of the evidence on which the staging assessment is based - *

- */ - public ResourceReferenceDt addAssessment() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getAssessment().add(newType); - return newType; - } - - - } - - - /** - * Block class for child element: Condition.evidence (Supporting evidence) - * - *

- * Definition: - * Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed - *

- */ - @Block() - public static class Evidence extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="code", type=CodeableConceptDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Manifestation/symptom", - formalDefinition="A manifestation or symptom that led to the recording of this condition" - ) - private CodeableConceptDt myCode; - - @Child(name="detail", order=1, min=0, max=Child.MAX_UNLIMITED, type={ - IResource.class }) - @Description( - shortDefinition="Supporting information found elsewhere", - formalDefinition="Links to other relevant information, including pathology reports" - ) - private java.util.List myDetail; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCode, myDetail); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCode, myDetail); - } - - /** - * Gets the value(s) for code (Manifestation/symptom). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A manifestation or symptom that led to the recording of this condition - *

- */ - public CodeableConceptDt getCode() { - if (myCode == null) { - myCode = new CodeableConceptDt(); - } - return myCode; - } - - /** - * Sets the value(s) for code (Manifestation/symptom) - * - *

- * Definition: - * A manifestation or symptom that led to the recording of this condition - *

- */ - public Evidence setCode(CodeableConceptDt theValue) { - myCode = theValue; - return this; - } - - - /** - * Gets the value(s) for detail (Supporting information found elsewhere). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Links to other relevant information, including pathology reports - *

- */ - public java.util.List getDetail() { - if (myDetail == null) { - myDetail = new java.util.ArrayList(); - } - return myDetail; - } - - /** - * Sets the value(s) for detail (Supporting information found elsewhere) - * - *

- * Definition: - * Links to other relevant information, including pathology reports - *

- */ - public Evidence setDetail(java.util.List theValue) { - myDetail = theValue; - return this; - } - - /** - * Adds and returns a new value for detail (Supporting information found elsewhere) - * - *

- * Definition: - * Links to other relevant information, including pathology reports - *

- */ - public ResourceReferenceDt addDetail() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getDetail().add(newType); - return newType; - } - - - } - - - /** - * Block class for child element: Condition.location (Anatomical location, if relevant) - * - *

- * Definition: - * The anatomical location where this condition manifests itself - *

- */ - @Block() - public static class Location extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="code", type=CodeableConceptDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Location - may include laterality", - formalDefinition="Code that identifies the structural location" - ) - private CodeableConceptDt myCode; - - @Child(name="detail", type=StringDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Precise location details", - formalDefinition="Detailed anatomical location information" - ) - private StringDt myDetail; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCode, myDetail); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCode, myDetail); - } - - /** - * Gets the value(s) for code (Location - may include laterality). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Code that identifies the structural location - *

- */ - public CodeableConceptDt getCode() { - if (myCode == null) { - myCode = new CodeableConceptDt(); - } - return myCode; - } - - /** - * Sets the value(s) for code (Location - may include laterality) - * - *

- * Definition: - * Code that identifies the structural location - *

- */ - public Location setCode(CodeableConceptDt theValue) { - myCode = theValue; - return this; - } - - - /** - * Gets the value(s) for detail (Precise location details). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Detailed anatomical location information - *

- */ - public StringDt getDetail() { - if (myDetail == null) { - myDetail = new StringDt(); - } - return myDetail; - } - - /** - * Sets the value(s) for detail (Precise location details) - * - *

- * Definition: - * Detailed anatomical location information - *

- */ - public Location setDetail(StringDt theValue) { - myDetail = theValue; - return this; - } - - /** - * Sets the value for detail (Precise location details) - * - *

- * Definition: - * Detailed anatomical location information - *

- */ - public Location setDetail( String theString) { - myDetail = new StringDt(theString); - return this; - } - - - - } - - - /** - * Block class for child element: Condition.relatedItem (Causes or precedents for this Condition) - * - *

- * Definition: - * Further conditions, problems, diagnoses, procedures or events that are related in some way to this condition, or the substance that caused/triggered this Condition - *

- */ - @Block() - public static class RelatedItem extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="type", type=CodeDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="due-to | following", - formalDefinition="The type of relationship that this condition has to the related item" - ) - private BoundCodeDt myType; - - @Child(name="code", type=CodeableConceptDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Relationship target by means of a predefined code", - formalDefinition="Code that identifies the target of this relationship. The code takes the place of a detailed instance target" - ) - private CodeableConceptDt myCode; - - @Child(name="target", order=2, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Condition.class, ca.uhn.fhir.model.dstu.resource.Procedure.class, ca.uhn.fhir.model.dstu.resource.MedicationAdministration.class, ca.uhn.fhir.model.dstu.resource.Immunization.class, ca.uhn.fhir.model.dstu.resource.MedicationStatement.class }) - @Description( - shortDefinition="Relationship target resource", - formalDefinition="Target of the relationship" - ) - private ResourceReferenceDt myTarget; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myType, myCode, myTarget); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myType, myCode, myTarget); - } - - /** - * Gets the value(s) for type (due-to | following). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The type of relationship that this condition has to the related item - *

- */ - public BoundCodeDt getType() { - if (myType == null) { - myType = new BoundCodeDt(ConditionRelationshipTypeEnum.VALUESET_BINDER); - } - return myType; - } - - /** - * Sets the value(s) for type (due-to | following) - * - *

- * Definition: - * The type of relationship that this condition has to the related item - *

- */ - public RelatedItem setType(BoundCodeDt theValue) { - myType = theValue; - return this; - } - - /** - * Sets the value(s) for type (due-to | following) - * - *

- * Definition: - * The type of relationship that this condition has to the related item - *

- */ - public RelatedItem setType(ConditionRelationshipTypeEnum theValue) { - getType().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for code (Relationship target by means of a predefined code). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Code that identifies the target of this relationship. The code takes the place of a detailed instance target - *

- */ - public CodeableConceptDt getCode() { - if (myCode == null) { - myCode = new CodeableConceptDt(); - } - return myCode; - } - - /** - * Sets the value(s) for code (Relationship target by means of a predefined code) - * - *

- * Definition: - * Code that identifies the target of this relationship. The code takes the place of a detailed instance target - *

- */ - public RelatedItem setCode(CodeableConceptDt theValue) { - myCode = theValue; - return this; - } - - - /** - * Gets the value(s) for target (Relationship target resource). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Target of the relationship - *

- */ - public ResourceReferenceDt getTarget() { - if (myTarget == null) { - myTarget = new ResourceReferenceDt(); - } - return myTarget; - } - - /** - * Sets the value(s) for target (Relationship target resource) - * - *

- * Definition: - * Target of the relationship - *

- */ - public RelatedItem setTarget(ResourceReferenceDt theValue) { - myTarget = theValue; - return this; - } - - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Coverage.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Coverage.java deleted file mode 100644 index 3247218e4ac..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Coverage.java +++ /dev/null @@ -1,977 +0,0 @@ - - - - - - - - - - - - - - - - -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.dstu.composite.AddressDt; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.composite.HumanNameDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.primitive.DateDt; -import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR Coverage Resource - * (Insurance or medical plan) - * - *

- * Definition: - * Financial instrument by which payment information for health care - *

- * - *

- * Requirements: - * Health care programs and insurers are significant payors of health service costs - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Coverage - *

- * - */ -@ResourceDef(name="Coverage", profile="http://hl7.org/fhir/profiles/Coverage", id="coverage") -public class Coverage extends BaseResource implements IResource { - - /** - * Search parameter constant for issuer - *

- * Description: The identity of the insurer
- * Type: reference
- * Path: Coverage.issuer
- *

- */ - @SearchParamDefinition(name="issuer", path="Coverage.issuer", description="The identity of the insurer", type="reference" ) - public static final String SP_ISSUER = "issuer"; - - /** - * Fluent Client search parameter constant for issuer - *

- * Description: The identity of the insurer
- * Type: reference
- * Path: Coverage.issuer
- *

- */ - public static final ReferenceClientParam ISSUER = new ReferenceClientParam(SP_ISSUER); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Coverage.issuer". - */ - public static final Include INCLUDE_ISSUER = new Include("Coverage.issuer"); - - /** - * Search parameter constant for identifier - *

- * Description: The primary identifier of the insured
- * Type: token
- * Path: Coverage.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Coverage.identifier", description="The primary identifier of the insured", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - - /** - * Fluent Client search parameter constant for identifier - *

- * Description: The primary identifier of the insured
- * Type: token
- * Path: Coverage.identifier
- *

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

- * Description: The kind of coverage
- * Type: token
- * Path: Coverage.type
- *

- */ - @SearchParamDefinition(name="type", path="Coverage.type", description="The kind of coverage", type="token" ) - public static final String SP_TYPE = "type"; - - /** - * Fluent Client search parameter constant for type - *

- * Description: The kind of coverage
- * Type: token
- * Path: Coverage.type
- *

- */ - public static final TokenClientParam TYPE = new TokenClientParam(SP_TYPE); - - /** - * Search parameter constant for plan - *

- * Description: A plan or policy identifier
- * Type: token
- * Path: Coverage.plan
- *

- */ - @SearchParamDefinition(name="plan", path="Coverage.plan", description="A plan or policy identifier", type="token" ) - public static final String SP_PLAN = "plan"; - - /** - * Fluent Client search parameter constant for plan - *

- * Description: A plan or policy identifier
- * Type: token
- * Path: Coverage.plan
- *

- */ - public static final TokenClientParam PLAN = new TokenClientParam(SP_PLAN); - - /** - * Search parameter constant for subplan - *

- * Description: Sub-plan identifier
- * Type: token
- * Path: Coverage.subplan
- *

- */ - @SearchParamDefinition(name="subplan", path="Coverage.subplan", description="Sub-plan identifier", type="token" ) - public static final String SP_SUBPLAN = "subplan"; - - /** - * Fluent Client search parameter constant for subplan - *

- * Description: Sub-plan identifier
- * Type: token
- * Path: Coverage.subplan
- *

- */ - public static final TokenClientParam SUBPLAN = new TokenClientParam(SP_SUBPLAN); - - /** - * Search parameter constant for group - *

- * Description: Group identifier
- * Type: token
- * Path: Coverage.group
- *

- */ - @SearchParamDefinition(name="group", path="Coverage.group", description="Group identifier", type="token" ) - public static final String SP_GROUP = "group"; - - /** - * Fluent Client search parameter constant for group - *

- * Description: Group identifier
- * Type: token
- * Path: Coverage.group
- *

- */ - public static final TokenClientParam GROUP = new TokenClientParam(SP_GROUP); - - /** - * Search parameter constant for dependent - *

- * Description: Dependent number
- * Type: token
- * Path: Coverage.dependent
- *

- */ - @SearchParamDefinition(name="dependent", path="Coverage.dependent", description="Dependent number", type="token" ) - public static final String SP_DEPENDENT = "dependent"; - - /** - * Fluent Client search parameter constant for dependent - *

- * Description: Dependent number
- * Type: token
- * Path: Coverage.dependent
- *

- */ - public static final TokenClientParam DEPENDENT = new TokenClientParam(SP_DEPENDENT); - - /** - * Search parameter constant for sequence - *

- * Description: Sequence number
- * Type: token
- * Path: Coverage.sequence
- *

- */ - @SearchParamDefinition(name="sequence", path="Coverage.sequence", description="Sequence number", type="token" ) - public static final String SP_SEQUENCE = "sequence"; - - /** - * Fluent Client search parameter constant for sequence - *

- * Description: Sequence number
- * Type: token
- * Path: Coverage.sequence
- *

- */ - public static final TokenClientParam SEQUENCE = new TokenClientParam(SP_SEQUENCE); - - /** - * Search parameter constant for name - *

- * Description: The name of the subscriber
- * Type: token
- * Path: Coverage.subscriber.name
- *

- */ - @SearchParamDefinition(name="name", path="Coverage.subscriber.name", description="The name of the subscriber", type="token" ) - public static final String SP_NAME = "name"; - - /** - * Fluent Client search parameter constant for name - *

- * Description: The name of the subscriber
- * Type: token
- * Path: Coverage.subscriber.name
- *

- */ - public static final TokenClientParam NAME = new TokenClientParam(SP_NAME); - - - @Child(name="issuer", order=0, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Organization.class }) - @Description( - shortDefinition="An identifier for the plan issuer", - formalDefinition="The program or plan underwriter or payor." - ) - private ResourceReferenceDt myIssuer; - - @Child(name="period", type=PeriodDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Coverage start and end dates", - formalDefinition="Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force." - ) - private PeriodDt myPeriod; - - @Child(name="type", type=CodingDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="Type of coverage", - formalDefinition="The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health." - ) - private CodingDt myType; - - @Child(name="identifier", type=IdentifierDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="The primary coverage ID", - formalDefinition="The main (and possibly only) identifier for the coverage - often referred to as a Subscriber Id, Certificate number or Personal Health Number or Case ID." - ) - private IdentifierDt myIdentifier; - - @Child(name="group", type=IdentifierDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="An identifier for the group", - formalDefinition="Todo" - ) - private IdentifierDt myGroup; - - @Child(name="plan", type=IdentifierDt.class, order=5, min=0, max=1) - @Description( - shortDefinition="An identifier for the plan", - formalDefinition="Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID." - ) - private IdentifierDt myPlan; - - @Child(name="subplan", type=IdentifierDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="An identifier for the subsection of the plan", - formalDefinition="Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID." - ) - private IdentifierDt mySubplan; - - @Child(name="dependent", type=IntegerDt.class, order=7, min=0, max=1) - @Description( - shortDefinition="The dependent number", - formalDefinition="A unique identifier for a dependent under the coverage." - ) - private IntegerDt myDependent; - - @Child(name="sequence", type=IntegerDt.class, order=8, min=0, max=1) - @Description( - shortDefinition="The plan instance or sequence counter", - formalDefinition="An optional counter for a particular instance of the identified coverage which increments upon each renewal." - ) - private IntegerDt mySequence; - - @Child(name="subscriber", order=9, min=0, max=1) - @Description( - shortDefinition="Planholder information", - formalDefinition="" - ) - private Subscriber mySubscriber; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIssuer, myPeriod, myType, myIdentifier, myGroup, myPlan, mySubplan, myDependent, mySequence, mySubscriber); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIssuer, myPeriod, myType, myIdentifier, myGroup, myPlan, mySubplan, myDependent, mySequence, mySubscriber); - } - - /** - * Gets the value(s) for issuer (An identifier for the plan issuer). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The program or plan underwriter or payor. - *

- */ - public ResourceReferenceDt getIssuer() { - if (myIssuer == null) { - myIssuer = new ResourceReferenceDt(); - } - return myIssuer; - } - - /** - * Sets the value(s) for issuer (An identifier for the plan issuer) - * - *

- * Definition: - * The program or plan underwriter or payor. - *

- */ - public Coverage setIssuer(ResourceReferenceDt theValue) { - myIssuer = theValue; - return this; - } - - - /** - * Gets the value(s) for period (Coverage start and end dates). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force. - *

- */ - public PeriodDt getPeriod() { - if (myPeriod == null) { - myPeriod = new PeriodDt(); - } - return myPeriod; - } - - /** - * Sets the value(s) for period (Coverage start and end dates) - * - *

- * Definition: - * Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force. - *

- */ - public Coverage setPeriod(PeriodDt theValue) { - myPeriod = theValue; - return this; - } - - - /** - * Gets the value(s) for type (Type of coverage). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health. - *

- */ - public CodingDt getType() { - if (myType == null) { - myType = new CodingDt(); - } - return myType; - } - - /** - * Sets the value(s) for type (Type of coverage) - * - *

- * Definition: - * The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health. - *

- */ - public Coverage setType(CodingDt theValue) { - myType = theValue; - return this; - } - - - /** - * Gets the value(s) for identifier (The primary coverage ID). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The main (and possibly only) identifier for the coverage - often referred to as a Subscriber Id, Certificate number or Personal Health Number or Case ID. - *

- */ - public IdentifierDt getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new IdentifierDt(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (The primary coverage ID) - * - *

- * Definition: - * The main (and possibly only) identifier for the coverage - often referred to as a Subscriber Id, Certificate number or Personal Health Number or Case ID. - *

- */ - public Coverage setIdentifier(IdentifierDt theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Sets the value for identifier (The primary coverage ID) - * - *

- * Definition: - * The main (and possibly only) identifier for the coverage - often referred to as a Subscriber Id, Certificate number or Personal Health Number or Case ID. - *

- */ - public Coverage setIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - myIdentifier = new IdentifierDt(theUse, theSystem, theValue, theLabel); - return this; - } - - /** - * Sets the value for identifier (The primary coverage ID) - * - *

- * Definition: - * The main (and possibly only) identifier for the coverage - often referred to as a Subscriber Id, Certificate number or Personal Health Number or Case ID. - *

- */ - public Coverage setIdentifier( String theSystem, String theValue) { - myIdentifier = new IdentifierDt(theSystem, theValue); - return this; - } - - - /** - * Gets the value(s) for group (An identifier for the group). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Todo - *

- */ - public IdentifierDt getGroup() { - if (myGroup == null) { - myGroup = new IdentifierDt(); - } - return myGroup; - } - - /** - * Sets the value(s) for group (An identifier for the group) - * - *

- * Definition: - * Todo - *

- */ - public Coverage setGroup(IdentifierDt theValue) { - myGroup = theValue; - return this; - } - - /** - * Sets the value for group (An identifier for the group) - * - *

- * Definition: - * Todo - *

- */ - public Coverage setGroup( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - myGroup = new IdentifierDt(theUse, theSystem, theValue, theLabel); - return this; - } - - /** - * Sets the value for group (An identifier for the group) - * - *

- * Definition: - * Todo - *

- */ - public Coverage setGroup( String theSystem, String theValue) { - myGroup = new IdentifierDt(theSystem, theValue); - return this; - } - - - /** - * Gets the value(s) for plan (An identifier for the plan). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. - *

- */ - public IdentifierDt getPlan() { - if (myPlan == null) { - myPlan = new IdentifierDt(); - } - return myPlan; - } - - /** - * Sets the value(s) for plan (An identifier for the plan) - * - *

- * Definition: - * Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. - *

- */ - public Coverage setPlan(IdentifierDt theValue) { - myPlan = theValue; - return this; - } - - /** - * Sets the value for plan (An identifier for the plan) - * - *

- * Definition: - * Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. - *

- */ - public Coverage setPlan( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - myPlan = new IdentifierDt(theUse, theSystem, theValue, theLabel); - return this; - } - - /** - * Sets the value for plan (An identifier for the plan) - * - *

- * Definition: - * Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. - *

- */ - public Coverage setPlan( String theSystem, String theValue) { - myPlan = new IdentifierDt(theSystem, theValue); - return this; - } - - - /** - * Gets the value(s) for subplan (An identifier for the subsection of the plan). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID. - *

- */ - public IdentifierDt getSubplan() { - if (mySubplan == null) { - mySubplan = new IdentifierDt(); - } - return mySubplan; - } - - /** - * Sets the value(s) for subplan (An identifier for the subsection of the plan) - * - *

- * Definition: - * Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID. - *

- */ - public Coverage setSubplan(IdentifierDt theValue) { - mySubplan = theValue; - return this; - } - - /** - * Sets the value for subplan (An identifier for the subsection of the plan) - * - *

- * Definition: - * Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID. - *

- */ - public Coverage setSubplan( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - mySubplan = new IdentifierDt(theUse, theSystem, theValue, theLabel); - return this; - } - - /** - * Sets the value for subplan (An identifier for the subsection of the plan) - * - *

- * Definition: - * Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID. - *

- */ - public Coverage setSubplan( String theSystem, String theValue) { - mySubplan = new IdentifierDt(theSystem, theValue); - return this; - } - - - /** - * Gets the value(s) for dependent (The dependent number). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A unique identifier for a dependent under the coverage. - *

- */ - public IntegerDt getDependent() { - if (myDependent == null) { - myDependent = new IntegerDt(); - } - return myDependent; - } - - /** - * Sets the value(s) for dependent (The dependent number) - * - *

- * Definition: - * A unique identifier for a dependent under the coverage. - *

- */ - public Coverage setDependent(IntegerDt theValue) { - myDependent = theValue; - return this; - } - - /** - * Sets the value for dependent (The dependent number) - * - *

- * Definition: - * A unique identifier for a dependent under the coverage. - *

- */ - public Coverage setDependent( int theInteger) { - myDependent = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for sequence (The plan instance or sequence counter). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * An optional counter for a particular instance of the identified coverage which increments upon each renewal. - *

- */ - public IntegerDt getSequence() { - if (mySequence == null) { - mySequence = new IntegerDt(); - } - return mySequence; - } - - /** - * Sets the value(s) for sequence (The plan instance or sequence counter) - * - *

- * Definition: - * An optional counter for a particular instance of the identified coverage which increments upon each renewal. - *

- */ - public Coverage setSequence(IntegerDt theValue) { - mySequence = theValue; - return this; - } - - /** - * Sets the value for sequence (The plan instance or sequence counter) - * - *

- * Definition: - * An optional counter for a particular instance of the identified coverage which increments upon each renewal. - *

- */ - public Coverage setSequence( int theInteger) { - mySequence = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for subscriber (Planholder information). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public Subscriber getSubscriber() { - if (mySubscriber == null) { - mySubscriber = new Subscriber(); - } - return mySubscriber; - } - - /** - * Sets the value(s) for subscriber (Planholder information) - * - *

- * Definition: - * - *

- */ - public Coverage setSubscriber(Subscriber theValue) { - mySubscriber = theValue; - return this; - } - - - /** - * Block class for child element: Coverage.subscriber (Planholder information) - * - *

- * Definition: - * - *

- */ - @Block() - public static class Subscriber extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="name", type=HumanNameDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="PolicyHolder name", - formalDefinition="The name of the PolicyHolder" - ) - private HumanNameDt myName; - - @Child(name="address", type=AddressDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="PolicyHolder address", - formalDefinition="The mailing address, typically home, of the PolicyHolder" - ) - private AddressDt myAddress; - - @Child(name="birthdate", type=DateDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="PolicyHolder date of birth", - formalDefinition="The date of birth of the PolicyHolder" - ) - private DateDt myBirthdate; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myName, myAddress, myBirthdate); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myName, myAddress, myBirthdate); - } - - /** - * Gets the value(s) for name (PolicyHolder name). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The name of the PolicyHolder - *

- */ - public HumanNameDt getName() { - if (myName == null) { - myName = new HumanNameDt(); - } - return myName; - } - - /** - * Sets the value(s) for name (PolicyHolder name) - * - *

- * Definition: - * The name of the PolicyHolder - *

- */ - public Subscriber setName(HumanNameDt theValue) { - myName = theValue; - return this; - } - - - /** - * Gets the value(s) for address (PolicyHolder address). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The mailing address, typically home, of the PolicyHolder - *

- */ - public AddressDt getAddress() { - if (myAddress == null) { - myAddress = new AddressDt(); - } - return myAddress; - } - - /** - * Sets the value(s) for address (PolicyHolder address) - * - *

- * Definition: - * The mailing address, typically home, of the PolicyHolder - *

- */ - public Subscriber setAddress(AddressDt theValue) { - myAddress = theValue; - return this; - } - - - /** - * Gets the value(s) for birthdate (PolicyHolder date of birth). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The date of birth of the PolicyHolder - *

- */ - public DateDt getBirthdate() { - if (myBirthdate == null) { - myBirthdate = new DateDt(); - } - return myBirthdate; - } - - /** - * Sets the value(s) for birthdate (PolicyHolder date of birth) - * - *

- * Definition: - * The date of birth of the PolicyHolder - *

- */ - public Subscriber setBirthdate(DateDt theValue) { - myBirthdate = theValue; - return this; - } - - /** - * Sets the value for birthdate (PolicyHolder date of birth) - * - *

- * Definition: - * The date of birth of the PolicyHolder - *

- */ - public Subscriber setBirthdateWithDayPrecision( Date theDate) { - myBirthdate = new DateDt(theDate); - return this; - } - - /** - * Sets the value for birthdate (PolicyHolder date of birth) - * - *

- * Definition: - * The date of birth of the PolicyHolder - *

- */ - public Subscriber setBirthdate( Date theDate, TemporalPrecisionEnum thePrecision) { - myBirthdate = new DateDt(theDate, thePrecision); - return this; - } - - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Device.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Device.java deleted file mode 100644 index 0d4d8e050e6..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Device.java +++ /dev/null @@ -1,1020 +0,0 @@ - - - - - - - - - - - - - - - - -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.BaseResource; -import ca.uhn.fhir.model.api.IElement; -import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.api.Include; -import ca.uhn.fhir.model.api.TemporalPrecisionEnum; -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.Description; -import ca.uhn.fhir.model.api.annotation.ResourceDef; -import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; -import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.ContactDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.primitive.DateDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.primitive.UriDt; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.StringClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR Device Resource - * (An instance of a manufactured thing that is used in the provision of healthcare) - * - *

- * Definition: - * This resource identifies an instance of a manufactured thing that is used in the provision of healthcare without being substantially changed through that activity. The device may be a machine, an insert, a computer, an application, etc. This includes durable (reusable) medical equipment as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health. - *

- * - *

- * Requirements: - * Allows institutions to track their devices. - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Device - *

- * - */ -@ResourceDef(name="Device", profile="http://hl7.org/fhir/profiles/Device", id="device") -public class Device extends BaseResource implements IResource { - - /** - * Search parameter constant for type - *

- * Description: The type of the device
- * Type: token
- * Path: Device.type
- *

- */ - @SearchParamDefinition(name="type", path="Device.type", description="The type of the device", type="token" ) - public static final String SP_TYPE = "type"; - - /** - * Fluent Client search parameter constant for type - *

- * Description: The type of the device
- * Type: token
- * Path: Device.type
- *

- */ - public static final TokenClientParam TYPE = new TokenClientParam(SP_TYPE); - - /** - * Search parameter constant for manufacturer - *

- * Description: The manufacturer of the device
- * Type: string
- * Path: Device.manufacturer
- *

- */ - @SearchParamDefinition(name="manufacturer", path="Device.manufacturer", description="The manufacturer of the device", type="string" ) - public static final String SP_MANUFACTURER = "manufacturer"; - - /** - * Fluent Client search parameter constant for manufacturer - *

- * Description: The manufacturer of the device
- * Type: string
- * Path: Device.manufacturer
- *

- */ - public static final StringClientParam MANUFACTURER = new StringClientParam(SP_MANUFACTURER); - - /** - * Search parameter constant for model - *

- * Description: The model of the device
- * Type: string
- * Path: Device.model
- *

- */ - @SearchParamDefinition(name="model", path="Device.model", description="The model of the device", type="string" ) - public static final String SP_MODEL = "model"; - - /** - * Fluent Client search parameter constant for model - *

- * Description: The model of the device
- * Type: string
- * Path: Device.model
- *

- */ - public static final StringClientParam MODEL = new StringClientParam(SP_MODEL); - - /** - * Search parameter constant for organization - *

- * Description: The organization responsible for the device
- * Type: reference
- * Path: Device.owner
- *

- */ - @SearchParamDefinition(name="organization", path="Device.owner", description="The organization responsible for the device", type="reference" ) - public static final String SP_ORGANIZATION = "organization"; - - /** - * Fluent Client search parameter constant for organization - *

- * Description: The organization responsible for the device
- * Type: reference
- * Path: Device.owner
- *

- */ - public static final ReferenceClientParam ORGANIZATION = new ReferenceClientParam(SP_ORGANIZATION); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Device.owner". - */ - public static final Include INCLUDE_OWNER = new Include("Device.owner"); - - /** - * Search parameter constant for identifier - *

- * Description:
- * Type: token
- * Path: Device.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Device.identifier", description="", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - - /** - * Fluent Client search parameter constant for identifier - *

- * Description:
- * Type: token
- * Path: Device.identifier
- *

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

- * Description: A location, where the resource is found
- * Type: reference
- * Path: Device.location
- *

- */ - @SearchParamDefinition(name="location", path="Device.location", description="A location, where the resource is found", type="reference" ) - public static final String SP_LOCATION = "location"; - - /** - * Fluent Client search parameter constant for location - *

- * Description: A location, where the resource is found
- * Type: reference
- * Path: Device.location
- *

- */ - public static final ReferenceClientParam LOCATION = new ReferenceClientParam(SP_LOCATION); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Device.location". - */ - public static final Include INCLUDE_LOCATION = new Include("Device.location"); - - /** - * Search parameter constant for patient - *

- * Description: Patient information, if the resource is affixed to a person
- * Type: reference
- * Path: Device.patient
- *

- */ - @SearchParamDefinition(name="patient", path="Device.patient", description="Patient information, if the resource is affixed to a person", type="reference" ) - public static final String SP_PATIENT = "patient"; - - /** - * Fluent Client search parameter constant for patient - *

- * Description: Patient information, if the resource is affixed to a person
- * Type: reference
- * Path: Device.patient
- *

- */ - public static final ReferenceClientParam PATIENT = new ReferenceClientParam(SP_PATIENT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Device.patient". - */ - public static final Include INCLUDE_PATIENT = new Include("Device.patient"); - - /** - * Search parameter constant for udi - *

- * Description:
- * Type: string
- * Path: Device.udi
- *

- */ - @SearchParamDefinition(name="udi", path="Device.udi", description="", type="string" ) - public static final String SP_UDI = "udi"; - - /** - * Fluent Client search parameter constant for udi - *

- * Description:
- * Type: string
- * Path: Device.udi
- *

- */ - public static final StringClientParam UDI = new StringClientParam(SP_UDI); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Instance id from manufacturer, owner and others", - formalDefinition="Identifiers assigned to this device by various organizations. The most likely organizations to assign identifiers are the manufacturer and the owner, though regulatory agencies may also assign an identifier. The identifiers identify the particular device, not the kind of device" - ) - private java.util.List myIdentifier; - - @Child(name="type", type=CodeableConceptDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="What kind of device this is", - formalDefinition="A kind of this device" - ) - private CodeableConceptDt myType; - - @Child(name="manufacturer", type=StringDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Name of device manufacturer", - formalDefinition="A name of the manufacturer" - ) - private StringDt myManufacturer; - - @Child(name="model", type=StringDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Model id assigned by the manufacturer", - formalDefinition="The \"model\" - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type" - ) - private StringDt myModel; - - @Child(name="version", type=StringDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="Version number (i.e. software)", - formalDefinition="The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware" - ) - private StringDt myVersion; - - @Child(name="expiry", type=DateDt.class, order=5, min=0, max=1) - @Description( - shortDefinition="Date of expiry of this device (if applicable)", - formalDefinition="Date of expiry of this device (if applicable)" - ) - private DateDt myExpiry; - - @Child(name="udi", type=StringDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="FDA Mandated Unique Device Identifier", - formalDefinition="FDA Mandated Unique Device Identifier. Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm" - ) - private StringDt myUdi; - - @Child(name="lotNumber", type=StringDt.class, order=7, min=0, max=1) - @Description( - shortDefinition="Lot number of manufacture", - formalDefinition="Lot number assigned by the manufacturer" - ) - private StringDt myLotNumber; - - @Child(name="owner", order=8, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Organization.class }) - @Description( - shortDefinition="Organization responsible for device", - formalDefinition="An organization that is responsible for the provision and ongoing maintenance of the device" - ) - private ResourceReferenceDt myOwner; - - @Child(name="location", order=9, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Location.class }) - @Description( - shortDefinition="Where the resource is found", - formalDefinition="The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. \"in/with the patient\"), or a coded location" - ) - private ResourceReferenceDt myLocation; - - @Child(name="patient", order=10, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="If the resource is affixed to a person", - formalDefinition="Patient information, if the resource is affixed to a person" - ) - private ResourceReferenceDt myPatient; - - @Child(name="contact", type=ContactDt.class, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Details for human/organization for support", - formalDefinition="Contact details for an organization or a particular human that is responsible for the device" - ) - private java.util.List myContact; - - @Child(name="url", type=UriDt.class, order=12, min=0, max=1) - @Description( - shortDefinition="Network address to contact device", - formalDefinition="A network address on which the device may be contacted directly" - ) - private UriDt myUrl; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myType, myManufacturer, myModel, myVersion, myExpiry, myUdi, myLotNumber, myOwner, myLocation, myPatient, myContact, myUrl); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myType, myManufacturer, myModel, myVersion, myExpiry, myUdi, myLotNumber, myOwner, myLocation, myPatient, myContact, myUrl); - } - - /** - * Gets the value(s) for identifier (Instance id from manufacturer, owner and others). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Instance id from manufacturer, owner and others) - * - *

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

- */ - public Device setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (Instance id from manufacturer, owner and others) - * - *

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

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (Instance id from manufacturer, owner and others), - * creating it if it does not already exist. - * - *

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

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (Instance id from manufacturer, owner and others) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Device addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (Instance id from manufacturer, owner and others) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Device addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for type (What kind of device this is). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A kind of this device - *

- */ - public CodeableConceptDt getType() { - if (myType == null) { - myType = new CodeableConceptDt(); - } - return myType; - } - - /** - * Sets the value(s) for type (What kind of device this is) - * - *

- * Definition: - * A kind of this device - *

- */ - public Device setType(CodeableConceptDt theValue) { - myType = theValue; - return this; - } - - - /** - * Gets the value(s) for manufacturer (Name of device manufacturer). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A name of the manufacturer - *

- */ - public StringDt getManufacturer() { - if (myManufacturer == null) { - myManufacturer = new StringDt(); - } - return myManufacturer; - } - - /** - * Sets the value(s) for manufacturer (Name of device manufacturer) - * - *

- * Definition: - * A name of the manufacturer - *

- */ - public Device setManufacturer(StringDt theValue) { - myManufacturer = theValue; - return this; - } - - /** - * Sets the value for manufacturer (Name of device manufacturer) - * - *

- * Definition: - * A name of the manufacturer - *

- */ - public Device setManufacturer( String theString) { - myManufacturer = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for model (Model id assigned by the manufacturer). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The \"model\" - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type - *

- */ - public StringDt getModel() { - if (myModel == null) { - myModel = new StringDt(); - } - return myModel; - } - - /** - * Sets the value(s) for model (Model id assigned by the manufacturer) - * - *

- * Definition: - * The \"model\" - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type - *

- */ - public Device setModel(StringDt theValue) { - myModel = theValue; - return this; - } - - /** - * Sets the value for model (Model id assigned by the manufacturer) - * - *

- * Definition: - * The \"model\" - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type - *

- */ - public Device setModel( String theString) { - myModel = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for version (Version number (i.e. software)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware - *

- */ - public StringDt getVersion() { - if (myVersion == null) { - myVersion = new StringDt(); - } - return myVersion; - } - - /** - * Sets the value(s) for version (Version number (i.e. software)) - * - *

- * Definition: - * The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware - *

- */ - public Device setVersion(StringDt theValue) { - myVersion = theValue; - return this; - } - - /** - * Sets the value for version (Version number (i.e. software)) - * - *

- * Definition: - * The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware - *

- */ - public Device setVersion( String theString) { - myVersion = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for expiry (Date of expiry of this device (if applicable)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Date of expiry of this device (if applicable) - *

- */ - public DateDt getExpiry() { - if (myExpiry == null) { - myExpiry = new DateDt(); - } - return myExpiry; - } - - /** - * Sets the value(s) for expiry (Date of expiry of this device (if applicable)) - * - *

- * Definition: - * Date of expiry of this device (if applicable) - *

- */ - public Device setExpiry(DateDt theValue) { - myExpiry = theValue; - return this; - } - - /** - * Sets the value for expiry (Date of expiry of this device (if applicable)) - * - *

- * Definition: - * Date of expiry of this device (if applicable) - *

- */ - public Device setExpiryWithDayPrecision( Date theDate) { - myExpiry = new DateDt(theDate); - return this; - } - - /** - * Sets the value for expiry (Date of expiry of this device (if applicable)) - * - *

- * Definition: - * Date of expiry of this device (if applicable) - *

- */ - public Device setExpiry( Date theDate, TemporalPrecisionEnum thePrecision) { - myExpiry = new DateDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for udi (FDA Mandated Unique Device Identifier). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * FDA Mandated Unique Device Identifier. Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm - *

- */ - public StringDt getUdi() { - if (myUdi == null) { - myUdi = new StringDt(); - } - return myUdi; - } - - /** - * Sets the value(s) for udi (FDA Mandated Unique Device Identifier) - * - *

- * Definition: - * FDA Mandated Unique Device Identifier. Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm - *

- */ - public Device setUdi(StringDt theValue) { - myUdi = theValue; - return this; - } - - /** - * Sets the value for udi (FDA Mandated Unique Device Identifier) - * - *

- * Definition: - * FDA Mandated Unique Device Identifier. Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm - *

- */ - public Device setUdi( String theString) { - myUdi = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for lotNumber (Lot number of manufacture). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Lot number assigned by the manufacturer - *

- */ - public StringDt getLotNumber() { - if (myLotNumber == null) { - myLotNumber = new StringDt(); - } - return myLotNumber; - } - - /** - * Sets the value(s) for lotNumber (Lot number of manufacture) - * - *

- * Definition: - * Lot number assigned by the manufacturer - *

- */ - public Device setLotNumber(StringDt theValue) { - myLotNumber = theValue; - return this; - } - - /** - * Sets the value for lotNumber (Lot number of manufacture) - * - *

- * Definition: - * Lot number assigned by the manufacturer - *

- */ - public Device setLotNumber( String theString) { - myLotNumber = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for owner (Organization responsible for device). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * An organization that is responsible for the provision and ongoing maintenance of the device - *

- */ - public ResourceReferenceDt getOwner() { - if (myOwner == null) { - myOwner = new ResourceReferenceDt(); - } - return myOwner; - } - - /** - * Sets the value(s) for owner (Organization responsible for device) - * - *

- * Definition: - * An organization that is responsible for the provision and ongoing maintenance of the device - *

- */ - public Device setOwner(ResourceReferenceDt theValue) { - myOwner = theValue; - return this; - } - - - /** - * Gets the value(s) for location (Where the resource is found). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. \"in/with the patient\"), or a coded location - *

- */ - public ResourceReferenceDt getLocation() { - if (myLocation == null) { - myLocation = new ResourceReferenceDt(); - } - return myLocation; - } - - /** - * Sets the value(s) for location (Where the resource is found) - * - *

- * Definition: - * The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. \"in/with the patient\"), or a coded location - *

- */ - public Device setLocation(ResourceReferenceDt theValue) { - myLocation = theValue; - return this; - } - - - /** - * Gets the value(s) for patient (If the resource is affixed to a person). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Patient information, if the resource is affixed to a person - *

- */ - public ResourceReferenceDt getPatient() { - if (myPatient == null) { - myPatient = new ResourceReferenceDt(); - } - return myPatient; - } - - /** - * Sets the value(s) for patient (If the resource is affixed to a person) - * - *

- * Definition: - * Patient information, if the resource is affixed to a person - *

- */ - public Device setPatient(ResourceReferenceDt theValue) { - myPatient = theValue; - return this; - } - - - /** - * Gets the value(s) for contact (Details for human/organization for support). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getContact() { - if (myContact == null) { - myContact = new java.util.ArrayList(); - } - return myContact; - } - - /** - * Sets the value(s) for contact (Details for human/organization for support) - * - *

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

- */ - public Device setContact(java.util.List theValue) { - myContact = theValue; - return this; - } - - /** - * Adds and returns a new value for contact (Details for human/organization for support) - * - *

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

- */ - public ContactDt addContact() { - ContactDt newType = new ContactDt(); - getContact().add(newType); - return newType; - } - - /** - * Gets the first repetition for contact (Details for human/organization for support), - * creating it if it does not already exist. - * - *

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

- */ - public ContactDt getContactFirstRep() { - if (getContact().isEmpty()) { - return addContact(); - } - return getContact().get(0); - } - /** - * Adds a new value for contact (Details for human/organization for support) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Device addContact( ContactUseEnum theContactUse, String theValue) { - if (myContact == null) { - myContact = new java.util.ArrayList(); - } - myContact.add(new ContactDt(theContactUse, theValue)); - return this; - } - - /** - * Adds a new value for contact (Details for human/organization for support) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Device addContact( String theValue) { - if (myContact == null) { - myContact = new java.util.ArrayList(); - } - myContact.add(new ContactDt(theValue)); - return this; - } - - - /** - * Gets the value(s) for url (Network address to contact device). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A network address on which the device may be contacted directly - *

- */ - public UriDt getUrl() { - if (myUrl == null) { - myUrl = new UriDt(); - } - return myUrl; - } - - /** - * Sets the value(s) for url (Network address to contact device) - * - *

- * Definition: - * A network address on which the device may be contacted directly - *

- */ - public Device setUrl(UriDt theValue) { - myUrl = theValue; - return this; - } - - /** - * Sets the value for url (Network address to contact device) - * - *

- * Definition: - * A network address on which the device may be contacted directly - *

- */ - public Device setUrl( String theUri) { - myUrl = new UriDt(theUri); - return this; - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DeviceObservationReport.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DeviceObservationReport.java deleted file mode 100644 index c684abe000b..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DeviceObservationReport.java +++ /dev/null @@ -1,824 +0,0 @@ - - - - - - - - - - - - - - - - -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.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.primitive.InstantDt; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR DeviceObservationReport Resource - * (Describes the data produced by a device at a point in time) - * - *

- * Definition: - * Describes the data produced by a device at a point in time - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/DeviceObservationReport - *

- * - */ -@ResourceDef(name="DeviceObservationReport", profile="http://hl7.org/fhir/profiles/DeviceObservationReport", id="deviceobservationreport") -public class DeviceObservationReport extends BaseResource implements IResource { - - /** - * Search parameter constant for source - *

- * Description:
- * Type: reference
- * Path: DeviceObservationReport.source
- *

- */ - @SearchParamDefinition(name="source", path="DeviceObservationReport.source", description="", type="reference" ) - public static final String SP_SOURCE = "source"; - - /** - * Fluent Client search parameter constant for source - *

- * Description:
- * Type: reference
- * Path: DeviceObservationReport.source
- *

- */ - public static final ReferenceClientParam SOURCE = new ReferenceClientParam(SP_SOURCE); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DeviceObservationReport.source". - */ - public static final Include INCLUDE_SOURCE = new Include("DeviceObservationReport.source"); - - /** - * Search parameter constant for code - *

- * Description: The compatment code
- * Type: token
- * Path: DeviceObservationReport.virtualDevice.code
- *

- */ - @SearchParamDefinition(name="code", path="DeviceObservationReport.virtualDevice.code", description="The compatment code", type="token" ) - public static final String SP_CODE = "code"; - - /** - * Fluent Client search parameter constant for code - *

- * Description: The compatment code
- * Type: token
- * Path: DeviceObservationReport.virtualDevice.code
- *

- */ - public static final TokenClientParam CODE = new TokenClientParam(SP_CODE); - - /** - * Search parameter constant for channel - *

- * Description: The channel code
- * Type: token
- * Path: DeviceObservationReport.virtualDevice.channel.code
- *

- */ - @SearchParamDefinition(name="channel", path="DeviceObservationReport.virtualDevice.channel.code", description="The channel code", type="token" ) - public static final String SP_CHANNEL = "channel"; - - /** - * Fluent Client search parameter constant for channel - *

- * Description: The channel code
- * Type: token
- * Path: DeviceObservationReport.virtualDevice.channel.code
- *

- */ - public static final TokenClientParam CHANNEL = new TokenClientParam(SP_CHANNEL); - - /** - * Search parameter constant for observation - *

- * Description:
- * Type: reference
- * Path: DeviceObservationReport.virtualDevice.channel.metric.observation
- *

- */ - @SearchParamDefinition(name="observation", path="DeviceObservationReport.virtualDevice.channel.metric.observation", description="", type="reference" ) - public static final String SP_OBSERVATION = "observation"; - - /** - * Fluent Client search parameter constant for observation - *

- * Description:
- * Type: reference
- * Path: DeviceObservationReport.virtualDevice.channel.metric.observation
- *

- */ - public static final ReferenceClientParam OBSERVATION = new ReferenceClientParam(SP_OBSERVATION); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DeviceObservationReport.virtualDevice.channel.metric.observation". - */ - public static final Include INCLUDE_VIRTUALDEVICE_CHANNEL_METRIC_OBSERVATION = new Include("DeviceObservationReport.virtualDevice.channel.metric.observation"); - - /** - * Search parameter constant for subject - *

- * Description:
- * Type: reference
- * Path: DeviceObservationReport.subject
- *

- */ - @SearchParamDefinition(name="subject", path="DeviceObservationReport.subject", description="", type="reference" ) - public static final String SP_SUBJECT = "subject"; - - /** - * Fluent Client search parameter constant for subject - *

- * Description:
- * Type: reference
- * Path: DeviceObservationReport.subject
- *

- */ - public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DeviceObservationReport.subject". - */ - public static final Include INCLUDE_SUBJECT = new Include("DeviceObservationReport.subject"); - - - @Child(name="instant", type=InstantDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="When the data values are reported", - formalDefinition="The point in time that the values are reported" - ) - private InstantDt myInstant; - - @Child(name="identifier", type=IdentifierDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="As assigned by the source device", - formalDefinition="An identifier assigned to this observation bu the source device that made the observation" - ) - private IdentifierDt myIdentifier; - - @Child(name="source", order=2, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Device.class }) - @Description( - shortDefinition="Identifies/describes where the data came from", - formalDefinition="Identification information for the device that is the source of the data" - ) - private ResourceReferenceDt mySource; - - @Child(name="subject", order=3, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.Device.class, ca.uhn.fhir.model.dstu.resource.Location.class }) - @Description( - shortDefinition="Subject of the measurement", - formalDefinition="The subject of the measurement" - ) - private ResourceReferenceDt mySubject; - - @Child(name="virtualDevice", order=4, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="A medical-related subsystem of a medical device", - formalDefinition="A medical-related subsystem of a medical device" - ) - private java.util.List myVirtualDevice; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myInstant, myIdentifier, mySource, mySubject, myVirtualDevice); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myInstant, myIdentifier, mySource, mySubject, myVirtualDevice); - } - - /** - * Gets the value(s) for instant (When the data values are reported). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The point in time that the values are reported - *

- */ - public InstantDt getInstant() { - if (myInstant == null) { - myInstant = new InstantDt(); - } - return myInstant; - } - - /** - * Sets the value(s) for instant (When the data values are reported) - * - *

- * Definition: - * The point in time that the values are reported - *

- */ - public DeviceObservationReport setInstant(InstantDt theValue) { - myInstant = theValue; - return this; - } - - /** - * Sets the value for instant (When the data values are reported) - * - *

- * Definition: - * The point in time that the values are reported - *

- */ - public DeviceObservationReport setInstant( Date theDate, TemporalPrecisionEnum thePrecision) { - myInstant = new InstantDt(theDate, thePrecision); - return this; - } - - /** - * Sets the value for instant (When the data values are reported) - * - *

- * Definition: - * The point in time that the values are reported - *

- */ - public DeviceObservationReport setInstantWithMillisPrecision( Date theDate) { - myInstant = new InstantDt(theDate); - return this; - } - - - /** - * Gets the value(s) for identifier (As assigned by the source device). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * An identifier assigned to this observation bu the source device that made the observation - *

- */ - public IdentifierDt getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new IdentifierDt(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (As assigned by the source device) - * - *

- * Definition: - * An identifier assigned to this observation bu the source device that made the observation - *

- */ - public DeviceObservationReport setIdentifier(IdentifierDt theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Sets the value for identifier (As assigned by the source device) - * - *

- * Definition: - * An identifier assigned to this observation bu the source device that made the observation - *

- */ - public DeviceObservationReport setIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - myIdentifier = new IdentifierDt(theUse, theSystem, theValue, theLabel); - return this; - } - - /** - * Sets the value for identifier (As assigned by the source device) - * - *

- * Definition: - * An identifier assigned to this observation bu the source device that made the observation - *

- */ - public DeviceObservationReport setIdentifier( String theSystem, String theValue) { - myIdentifier = new IdentifierDt(theSystem, theValue); - return this; - } - - - /** - * Gets the value(s) for source (Identifies/describes where the data came from). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identification information for the device that is the source of the data - *

- */ - public ResourceReferenceDt getSource() { - if (mySource == null) { - mySource = new ResourceReferenceDt(); - } - return mySource; - } - - /** - * Sets the value(s) for source (Identifies/describes where the data came from) - * - *

- * Definition: - * Identification information for the device that is the source of the data - *

- */ - public DeviceObservationReport setSource(ResourceReferenceDt theValue) { - mySource = theValue; - return this; - } - - - /** - * Gets the value(s) for subject (Subject of the measurement). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The subject of the measurement - *

- */ - public ResourceReferenceDt getSubject() { - if (mySubject == null) { - mySubject = new ResourceReferenceDt(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (Subject of the measurement) - * - *

- * Definition: - * The subject of the measurement - *

- */ - public DeviceObservationReport setSubject(ResourceReferenceDt theValue) { - mySubject = theValue; - return this; - } - - - /** - * Gets the value(s) for virtualDevice (A medical-related subsystem of a medical device). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A medical-related subsystem of a medical device - *

- */ - public java.util.List getVirtualDevice() { - if (myVirtualDevice == null) { - myVirtualDevice = new java.util.ArrayList(); - } - return myVirtualDevice; - } - - /** - * Sets the value(s) for virtualDevice (A medical-related subsystem of a medical device) - * - *

- * Definition: - * A medical-related subsystem of a medical device - *

- */ - public DeviceObservationReport setVirtualDevice(java.util.List theValue) { - myVirtualDevice = theValue; - return this; - } - - /** - * Adds and returns a new value for virtualDevice (A medical-related subsystem of a medical device) - * - *

- * Definition: - * A medical-related subsystem of a medical device - *

- */ - public VirtualDevice addVirtualDevice() { - VirtualDevice newType = new VirtualDevice(); - getVirtualDevice().add(newType); - return newType; - } - - /** - * Gets the first repetition for virtualDevice (A medical-related subsystem of a medical device), - * creating it if it does not already exist. - * - *

- * Definition: - * A medical-related subsystem of a medical device - *

- */ - public VirtualDevice getVirtualDeviceFirstRep() { - if (getVirtualDevice().isEmpty()) { - return addVirtualDevice(); - } - return getVirtualDevice().get(0); - } - - /** - * Block class for child element: DeviceObservationReport.virtualDevice (A medical-related subsystem of a medical device) - * - *

- * Definition: - * A medical-related subsystem of a medical device - *

- */ - @Block() - public static class VirtualDevice extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="code", type=CodeableConceptDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Describes the compartment", - formalDefinition="Describes the compartment" - ) - private CodeableConceptDt myCode; - - @Child(name="channel", order=1, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Groups related data items", - formalDefinition="Groups together physiological measurement data and derived data" - ) - private java.util.List myChannel; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCode, myChannel); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCode, myChannel); - } - - /** - * Gets the value(s) for code (Describes the compartment). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Describes the compartment - *

- */ - public CodeableConceptDt getCode() { - if (myCode == null) { - myCode = new CodeableConceptDt(); - } - return myCode; - } - - /** - * Sets the value(s) for code (Describes the compartment) - * - *

- * Definition: - * Describes the compartment - *

- */ - public VirtualDevice setCode(CodeableConceptDt theValue) { - myCode = theValue; - return this; - } - - - /** - * Gets the value(s) for channel (Groups related data items). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Groups together physiological measurement data and derived data - *

- */ - public java.util.List getChannel() { - if (myChannel == null) { - myChannel = new java.util.ArrayList(); - } - return myChannel; - } - - /** - * Sets the value(s) for channel (Groups related data items) - * - *

- * Definition: - * Groups together physiological measurement data and derived data - *

- */ - public VirtualDevice setChannel(java.util.List theValue) { - myChannel = theValue; - return this; - } - - /** - * Adds and returns a new value for channel (Groups related data items) - * - *

- * Definition: - * Groups together physiological measurement data and derived data - *

- */ - public VirtualDeviceChannel addChannel() { - VirtualDeviceChannel newType = new VirtualDeviceChannel(); - getChannel().add(newType); - return newType; - } - - /** - * Gets the first repetition for channel (Groups related data items), - * creating it if it does not already exist. - * - *

- * Definition: - * Groups together physiological measurement data and derived data - *

- */ - public VirtualDeviceChannel getChannelFirstRep() { - if (getChannel().isEmpty()) { - return addChannel(); - } - return getChannel().get(0); - } - - - } - - /** - * Block class for child element: DeviceObservationReport.virtualDevice.channel (Groups related data items) - * - *

- * Definition: - * Groups together physiological measurement data and derived data - *

- */ - @Block() - public static class VirtualDeviceChannel extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="code", type=CodeableConceptDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Describes the channel", - formalDefinition="Describes the channel" - ) - private CodeableConceptDt myCode; - - @Child(name="metric", order=1, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Piece of data reported by device", - formalDefinition="A piece of measured or derived data that is reported by the machine" - ) - private java.util.List myMetric; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCode, myMetric); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCode, myMetric); - } - - /** - * Gets the value(s) for code (Describes the channel). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Describes the channel - *

- */ - public CodeableConceptDt getCode() { - if (myCode == null) { - myCode = new CodeableConceptDt(); - } - return myCode; - } - - /** - * Sets the value(s) for code (Describes the channel) - * - *

- * Definition: - * Describes the channel - *

- */ - public VirtualDeviceChannel setCode(CodeableConceptDt theValue) { - myCode = theValue; - return this; - } - - - /** - * Gets the value(s) for metric (Piece of data reported by device). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A piece of measured or derived data that is reported by the machine - *

- */ - public java.util.List getMetric() { - if (myMetric == null) { - myMetric = new java.util.ArrayList(); - } - return myMetric; - } - - /** - * Sets the value(s) for metric (Piece of data reported by device) - * - *

- * Definition: - * A piece of measured or derived data that is reported by the machine - *

- */ - public VirtualDeviceChannel setMetric(java.util.List theValue) { - myMetric = theValue; - return this; - } - - /** - * Adds and returns a new value for metric (Piece of data reported by device) - * - *

- * Definition: - * A piece of measured or derived data that is reported by the machine - *

- */ - public VirtualDeviceChannelMetric addMetric() { - VirtualDeviceChannelMetric newType = new VirtualDeviceChannelMetric(); - getMetric().add(newType); - return newType; - } - - /** - * Gets the first repetition for metric (Piece of data reported by device), - * creating it if it does not already exist. - * - *

- * Definition: - * A piece of measured or derived data that is reported by the machine - *

- */ - public VirtualDeviceChannelMetric getMetricFirstRep() { - if (getMetric().isEmpty()) { - return addMetric(); - } - return getMetric().get(0); - } - - - } - - /** - * Block class for child element: DeviceObservationReport.virtualDevice.channel.metric (Piece of data reported by device) - * - *

- * Definition: - * A piece of measured or derived data that is reported by the machine - *

- */ - @Block() - public static class VirtualDeviceChannelMetric extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="observation", order=0, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Observation.class }) - @Description( - shortDefinition="The data for the metric", - formalDefinition="The data for the metric" - ) - private ResourceReferenceDt myObservation; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myObservation); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myObservation); - } - - /** - * Gets the value(s) for observation (The data for the metric). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The data for the metric - *

- */ - public ResourceReferenceDt getObservation() { - if (myObservation == null) { - myObservation = new ResourceReferenceDt(); - } - return myObservation; - } - - /** - * Sets the value(s) for observation (The data for the metric) - * - *

- * Definition: - * The data for the metric - *

- */ - public VirtualDeviceChannelMetric setObservation(ResourceReferenceDt theValue) { - myObservation = theValue; - return this; - } - - - - } - - - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DiagnosticOrder.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DiagnosticOrder.java deleted file mode 100644 index 7542556caf7..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DiagnosticOrder.java +++ /dev/null @@ -1,1535 +0,0 @@ - - - - - - - - - - - - - - - - -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.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderPriorityEnum; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderStatusEnum; -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.DateTimeDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.rest.gclient.CompositeClientParam; -import ca.uhn.fhir.rest.gclient.DateClientParam; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR DiagnosticOrder Resource - * (A request for a diagnostic service) - * - *

- * Definition: - * A request for a diagnostic investigation service to be performed - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/DiagnosticOrder - *

- * - */ -@ResourceDef(name="DiagnosticOrder", profile="http://hl7.org/fhir/profiles/DiagnosticOrder", id="diagnosticorder") -public class DiagnosticOrder extends BaseResource implements IResource { - - /** - * Search parameter constant for actor - *

- * Description:
- * Type: reference
- * Path: DiagnosticOrder.event.actor | DiagnosticOrder.item.event.actor
- *

- */ - @SearchParamDefinition(name="actor", path="DiagnosticOrder.event.actor | DiagnosticOrder.item.event.actor", description="", type="reference" ) - public static final String SP_ACTOR = "actor"; - - /** - * Fluent Client search parameter constant for actor - *

- * Description:
- * Type: reference
- * Path: DiagnosticOrder.event.actor | DiagnosticOrder.item.event.actor
- *

- */ - public static final ReferenceClientParam ACTOR = new ReferenceClientParam(SP_ACTOR); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DiagnosticOrder.event.actor". - */ - public static final Include INCLUDE_EVENT_ACTOR = new Include("DiagnosticOrder.event.actor"); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DiagnosticOrder.item.event.actor". - */ - public static final Include INCLUDE_ITEM_EVENT_ACTOR = new Include("DiagnosticOrder.item.event.actor"); - - /** - * Search parameter constant for bodysite - *

- * Description:
- * Type: token
- * Path: DiagnosticOrder.item.bodySite
- *

- */ - @SearchParamDefinition(name="bodysite", path="DiagnosticOrder.item.bodySite", description="", type="token" ) - public static final String SP_BODYSITE = "bodysite"; - - /** - * Fluent Client search parameter constant for bodysite - *

- * Description:
- * Type: token
- * Path: DiagnosticOrder.item.bodySite
- *

- */ - public static final TokenClientParam BODYSITE = new TokenClientParam(SP_BODYSITE); - - /** - * Search parameter constant for code - *

- * Description:
- * Type: token
- * Path: DiagnosticOrder.item.code
- *

- */ - @SearchParamDefinition(name="code", path="DiagnosticOrder.item.code", description="", type="token" ) - public static final String SP_CODE = "code"; - - /** - * Fluent Client search parameter constant for code - *

- * Description:
- * Type: token
- * Path: DiagnosticOrder.item.code
- *

- */ - public static final TokenClientParam CODE = new TokenClientParam(SP_CODE); - - /** - * Search parameter constant for event-date - *

- * Description:
- * Type: date
- * Path: DiagnosticOrder.event.dateTime
- *

- */ - @SearchParamDefinition(name="event-date", path="DiagnosticOrder.event.dateTime", description="", type="date" ) - public static final String SP_EVENT_DATE = "event-date"; - - /** - * Fluent Client search parameter constant for event-date - *

- * Description:
- * Type: date
- * Path: DiagnosticOrder.event.dateTime
- *

- */ - public static final DateClientParam EVENT_DATE = new DateClientParam(SP_EVENT_DATE); - - /** - * Search parameter constant for encounter - *

- * Description:
- * Type: reference
- * Path: DiagnosticOrder.encounter
- *

- */ - @SearchParamDefinition(name="encounter", path="DiagnosticOrder.encounter", description="", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - - /** - * Fluent Client search parameter constant for encounter - *

- * Description:
- * Type: reference
- * Path: DiagnosticOrder.encounter
- *

- */ - public static final ReferenceClientParam ENCOUNTER = new ReferenceClientParam(SP_ENCOUNTER); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DiagnosticOrder.encounter". - */ - public static final Include INCLUDE_ENCOUNTER = new Include("DiagnosticOrder.encounter"); - - /** - * Search parameter constant for identifier - *

- * Description:
- * Type: token
- * Path: DiagnosticOrder.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="DiagnosticOrder.identifier", description="", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - - /** - * Fluent Client search parameter constant for identifier - *

- * Description:
- * Type: token
- * Path: DiagnosticOrder.identifier
- *

- */ - public static final TokenClientParam IDENTIFIER = new TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter constant for item-date - *

- * Description:
- * Type: date
- * Path: DiagnosticOrder.item.event.dateTime
- *

- */ - @SearchParamDefinition(name="item-date", path="DiagnosticOrder.item.event.dateTime", description="", type="date" ) - public static final String SP_ITEM_DATE = "item-date"; - - /** - * Fluent Client search parameter constant for item-date - *

- * Description:
- * Type: date
- * Path: DiagnosticOrder.item.event.dateTime
- *

- */ - public static final DateClientParam ITEM_DATE = new DateClientParam(SP_ITEM_DATE); - - /** - * Search parameter constant for item-past-status - *

- * Description:
- * Type: token
- * Path: DiagnosticOrder.item.event.status
- *

- */ - @SearchParamDefinition(name="item-past-status", path="DiagnosticOrder.item.event.status", description="", type="token" ) - public static final String SP_ITEM_PAST_STATUS = "item-past-status"; - - /** - * Fluent Client search parameter constant for item-past-status - *

- * Description:
- * Type: token
- * Path: DiagnosticOrder.item.event.status
- *

- */ - public static final TokenClientParam ITEM_PAST_STATUS = new TokenClientParam(SP_ITEM_PAST_STATUS); - - /** - * Search parameter constant for item-status - *

- * Description:
- * Type: token
- * Path: DiagnosticOrder.item.status
- *

- */ - @SearchParamDefinition(name="item-status", path="DiagnosticOrder.item.status", description="", type="token" ) - public static final String SP_ITEM_STATUS = "item-status"; - - /** - * Fluent Client search parameter constant for item-status - *

- * Description:
- * Type: token
- * Path: DiagnosticOrder.item.status
- *

- */ - public static final TokenClientParam ITEM_STATUS = new TokenClientParam(SP_ITEM_STATUS); - - /** - * Search parameter constant for orderer - *

- * Description:
- * Type: reference
- * Path: DiagnosticOrder.orderer
- *

- */ - @SearchParamDefinition(name="orderer", path="DiagnosticOrder.orderer", description="", type="reference" ) - public static final String SP_ORDERER = "orderer"; - - /** - * Fluent Client search parameter constant for orderer - *

- * Description:
- * Type: reference
- * Path: DiagnosticOrder.orderer
- *

- */ - public static final ReferenceClientParam ORDERER = new ReferenceClientParam(SP_ORDERER); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DiagnosticOrder.orderer". - */ - public static final Include INCLUDE_ORDERER = new Include("DiagnosticOrder.orderer"); - - /** - * Search parameter constant for event-status - *

- * Description:
- * Type: token
- * Path: DiagnosticOrder.event.status
- *

- */ - @SearchParamDefinition(name="event-status", path="DiagnosticOrder.event.status", description="", type="token" ) - public static final String SP_EVENT_STATUS = "event-status"; - - /** - * Fluent Client search parameter constant for event-status - *

- * Description:
- * Type: token
- * Path: DiagnosticOrder.event.status
- *

- */ - public static final TokenClientParam EVENT_STATUS = new TokenClientParam(SP_EVENT_STATUS); - - /** - * Search parameter constant for specimen - *

- * Description:
- * Type: reference
- * Path: DiagnosticOrder.specimen | DiagnosticOrder.item.specimen
- *

- */ - @SearchParamDefinition(name="specimen", path="DiagnosticOrder.specimen | DiagnosticOrder.item.specimen", description="", type="reference" ) - public static final String SP_SPECIMEN = "specimen"; - - /** - * Fluent Client search parameter constant for specimen - *

- * Description:
- * Type: reference
- * Path: DiagnosticOrder.specimen | DiagnosticOrder.item.specimen
- *

- */ - public static final ReferenceClientParam SPECIMEN = new ReferenceClientParam(SP_SPECIMEN); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DiagnosticOrder.specimen". - */ - public static final Include INCLUDE_SPECIMEN = new Include("DiagnosticOrder.specimen"); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DiagnosticOrder.item.specimen". - */ - public static final Include INCLUDE_ITEM_SPECIMEN = new Include("DiagnosticOrder.item.specimen"); - - /** - * Search parameter constant for status - *

- * Description:
- * Type: token
- * Path: DiagnosticOrder.status
- *

- */ - @SearchParamDefinition(name="status", path="DiagnosticOrder.status", description="", type="token" ) - public static final String SP_STATUS = "status"; - - /** - * Fluent Client search parameter constant for status - *

- * Description:
- * Type: token
- * Path: DiagnosticOrder.status
- *

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

- * Description:
- * Type: reference
- * Path: DiagnosticOrder.subject
- *

- */ - @SearchParamDefinition(name="subject", path="DiagnosticOrder.subject", description="", type="reference" ) - public static final String SP_SUBJECT = "subject"; - - /** - * Fluent Client search parameter constant for subject - *

- * Description:
- * Type: reference
- * Path: DiagnosticOrder.subject
- *

- */ - public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DiagnosticOrder.subject". - */ - public static final Include INCLUDE_SUBJECT = new Include("DiagnosticOrder.subject"); - - /** - * Search parameter constant for item-past-status-item-date - *

- * Description: A combination of item-past-status and item-date
- * Type: composite
- * Path: item-past-status & item-date
- *

- */ - @SearchParamDefinition(name="item-past-status-item-date", path="item-past-status & item-date", description="A combination of item-past-status and item-date", type="composite" , compositeOf={ "item-past-status", "item-date" } ) - public static final String SP_ITEM_PAST_STATUS_ITEM_DATE = "item-past-status-item-date"; - - /** - * Fluent Client search parameter constant for item-past-status-item-date - *

- * Description: A combination of item-past-status and item-date
- * Type: composite
- * Path: item-past-status & item-date
- *

- */ - public static final CompositeClientParam ITEM_PAST_STATUS_ITEM_DATE = new CompositeClientParam(SP_ITEM_PAST_STATUS_ITEM_DATE); - - /** - * Search parameter constant for event-status-event-date - *

- * Description: A combination of past-status and date
- * Type: composite
- * Path: event-status & event-date
- *

- */ - @SearchParamDefinition(name="event-status-event-date", path="event-status & event-date", description="A combination of past-status and date", type="composite" , compositeOf={ "event-status", "event-date" } ) - public static final String SP_EVENT_STATUS_EVENT_DATE = "event-status-event-date"; - - /** - * Fluent Client search parameter constant for event-status-event-date - *

- * Description: A combination of past-status and date
- * Type: composite
- * Path: event-status & event-date
- *

- */ - public static final CompositeClientParam EVENT_STATUS_EVENT_DATE = new CompositeClientParam(SP_EVENT_STATUS_EVENT_DATE); - - - @Child(name="subject", order=0, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.Group.class, ca.uhn.fhir.model.dstu.resource.Location.class, ca.uhn.fhir.model.dstu.resource.Device.class }) - @Description( - shortDefinition="Who and/or what test is about", - formalDefinition="Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans)" - ) - private ResourceReferenceDt mySubject; - - @Child(name="orderer", order=1, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class }) - @Description( - shortDefinition="Who ordered the test", - formalDefinition="The practitioner that holds legal responsibility for ordering the investigation" - ) - private ResourceReferenceDt myOrderer; - - @Child(name="identifier", type=IdentifierDt.class, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Identifiers assigned to this order", - formalDefinition="Identifiers assigned to this order by the order or by the receiver" - ) - private java.util.List myIdentifier; - - @Child(name="encounter", order=3, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Encounter.class }) - @Description( - shortDefinition="The encounter that this diagnostic order is associated with", - formalDefinition="An encounter that provides additional informaton about the healthcare context in which this request is made" - ) - private ResourceReferenceDt myEncounter; - - @Child(name="clinicalNotes", type=StringDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="Explanation/Justification for test", - formalDefinition="An explanation or justification for why this diagnostic investigation is being requested" - ) - private StringDt myClinicalNotes; - - @Child(name="specimen", order=5, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Specimen.class }) - @Description( - shortDefinition="If the whole order relates to specific specimens", - formalDefinition="One or more specimens that the diagnostic investigation is about" - ) - private java.util.List mySpecimen; - - @Child(name="status", type=CodeDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="requested | received | accepted | in progress | review | completed | suspended | rejected | failed", - formalDefinition="The status of the order" - ) - private BoundCodeDt myStatus; - - @Child(name="priority", type=CodeDt.class, order=7, min=0, max=1) - @Description( - shortDefinition="routine | urgent | stat | asap", - formalDefinition="The clinical priority associated with this order" - ) - private BoundCodeDt myPriority; - - @Child(name="event", order=8, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="A list of events of interest in the lifecycle", - formalDefinition="A summary of the events of interest that have occurred as the request is processed. E.g. when the order was made, various processing steps (specimens received), when it was completed" - ) - private java.util.List myEvent; - - @Child(name="item", order=9, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="The items the orderer requested", - formalDefinition="The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested" - ) - private java.util.List myItem; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySubject, myOrderer, myIdentifier, myEncounter, myClinicalNotes, mySpecimen, myStatus, myPriority, myEvent, myItem); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySubject, myOrderer, myIdentifier, myEncounter, myClinicalNotes, mySpecimen, myStatus, myPriority, myEvent, myItem); - } - - /** - * Gets the value(s) for subject (Who and/or what test is about). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans) - *

- */ - public ResourceReferenceDt getSubject() { - if (mySubject == null) { - mySubject = new ResourceReferenceDt(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (Who and/or what test is about) - * - *

- * Definition: - * Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans) - *

- */ - public DiagnosticOrder setSubject(ResourceReferenceDt theValue) { - mySubject = theValue; - return this; - } - - - /** - * Gets the value(s) for orderer (Who ordered the test). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The practitioner that holds legal responsibility for ordering the investigation - *

- */ - public ResourceReferenceDt getOrderer() { - if (myOrderer == null) { - myOrderer = new ResourceReferenceDt(); - } - return myOrderer; - } - - /** - * Sets the value(s) for orderer (Who ordered the test) - * - *

- * Definition: - * The practitioner that holds legal responsibility for ordering the investigation - *

- */ - public DiagnosticOrder setOrderer(ResourceReferenceDt theValue) { - myOrderer = theValue; - return this; - } - - - /** - * Gets the value(s) for identifier (Identifiers assigned to this order). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Identifiers assigned to this order) - * - *

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

- */ - public DiagnosticOrder setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (Identifiers assigned to this order) - * - *

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

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (Identifiers assigned to this order), - * creating it if it does not already exist. - * - *

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

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (Identifiers assigned to this order) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public DiagnosticOrder addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (Identifiers assigned to this order) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public DiagnosticOrder addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for encounter (The encounter that this diagnostic order is associated with). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * An encounter that provides additional informaton about the healthcare context in which this request is made - *

- */ - public ResourceReferenceDt getEncounter() { - if (myEncounter == null) { - myEncounter = new ResourceReferenceDt(); - } - return myEncounter; - } - - /** - * Sets the value(s) for encounter (The encounter that this diagnostic order is associated with) - * - *

- * Definition: - * An encounter that provides additional informaton about the healthcare context in which this request is made - *

- */ - public DiagnosticOrder setEncounter(ResourceReferenceDt theValue) { - myEncounter = theValue; - return this; - } - - - /** - * Gets the value(s) for clinicalNotes (Explanation/Justification for test). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * An explanation or justification for why this diagnostic investigation is being requested - *

- */ - public StringDt getClinicalNotes() { - if (myClinicalNotes == null) { - myClinicalNotes = new StringDt(); - } - return myClinicalNotes; - } - - /** - * Sets the value(s) for clinicalNotes (Explanation/Justification for test) - * - *

- * Definition: - * An explanation or justification for why this diagnostic investigation is being requested - *

- */ - public DiagnosticOrder setClinicalNotes(StringDt theValue) { - myClinicalNotes = theValue; - return this; - } - - /** - * Sets the value for clinicalNotes (Explanation/Justification for test) - * - *

- * Definition: - * An explanation or justification for why this diagnostic investigation is being requested - *

- */ - public DiagnosticOrder setClinicalNotes( String theString) { - myClinicalNotes = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for specimen (If the whole order relates to specific specimens). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getSpecimen() { - if (mySpecimen == null) { - mySpecimen = new java.util.ArrayList(); - } - return mySpecimen; - } - - /** - * Sets the value(s) for specimen (If the whole order relates to specific specimens) - * - *

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

- */ - public DiagnosticOrder setSpecimen(java.util.List theValue) { - mySpecimen = theValue; - return this; - } - - /** - * Adds and returns a new value for specimen (If the whole order relates to specific specimens) - * - *

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

- */ - public ResourceReferenceDt addSpecimen() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getSpecimen().add(newType); - return newType; - } - - /** - * Gets the value(s) for status (requested | received | accepted | in progress | review | completed | suspended | rejected | failed). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The status of the order - *

- */ - public BoundCodeDt getStatus() { - if (myStatus == null) { - myStatus = new BoundCodeDt(DiagnosticOrderStatusEnum.VALUESET_BINDER); - } - return myStatus; - } - - /** - * Sets the value(s) for status (requested | received | accepted | in progress | review | completed | suspended | rejected | failed) - * - *

- * Definition: - * The status of the order - *

- */ - public DiagnosticOrder setStatus(BoundCodeDt theValue) { - myStatus = theValue; - return this; - } - - /** - * Sets the value(s) for status (requested | received | accepted | in progress | review | completed | suspended | rejected | failed) - * - *

- * Definition: - * The status of the order - *

- */ - public DiagnosticOrder setStatus(DiagnosticOrderStatusEnum theValue) { - getStatus().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for priority (routine | urgent | stat | asap). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The clinical priority associated with this order - *

- */ - public BoundCodeDt getPriority() { - if (myPriority == null) { - myPriority = new BoundCodeDt(DiagnosticOrderPriorityEnum.VALUESET_BINDER); - } - return myPriority; - } - - /** - * Sets the value(s) for priority (routine | urgent | stat | asap) - * - *

- * Definition: - * The clinical priority associated with this order - *

- */ - public DiagnosticOrder setPriority(BoundCodeDt theValue) { - myPriority = theValue; - return this; - } - - /** - * Sets the value(s) for priority (routine | urgent | stat | asap) - * - *

- * Definition: - * The clinical priority associated with this order - *

- */ - public DiagnosticOrder setPriority(DiagnosticOrderPriorityEnum theValue) { - getPriority().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for event (A list of events of interest in the lifecycle). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getEvent() { - if (myEvent == null) { - myEvent = new java.util.ArrayList(); - } - return myEvent; - } - - /** - * Sets the value(s) for event (A list of events of interest in the lifecycle) - * - *

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

- */ - public DiagnosticOrder setEvent(java.util.List theValue) { - myEvent = theValue; - return this; - } - - /** - * Adds and returns a new value for event (A list of events of interest in the lifecycle) - * - *

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

- */ - public Event addEvent() { - Event newType = new Event(); - getEvent().add(newType); - return newType; - } - - /** - * Gets the first repetition for event (A list of events of interest in the lifecycle), - * creating it if it does not already exist. - * - *

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

- */ - public Event getEventFirstRep() { - if (getEvent().isEmpty()) { - return addEvent(); - } - return getEvent().get(0); - } - - /** - * Gets the value(s) for item (The items the orderer requested). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getItem() { - if (myItem == null) { - myItem = new java.util.ArrayList(); - } - return myItem; - } - - /** - * Sets the value(s) for item (The items the orderer requested) - * - *

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

- */ - public DiagnosticOrder setItem(java.util.List theValue) { - myItem = theValue; - return this; - } - - /** - * Adds and returns a new value for item (The items the orderer requested) - * - *

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

- */ - public Item addItem() { - Item newType = new Item(); - getItem().add(newType); - return newType; - } - - /** - * Gets the first repetition for item (The items the orderer requested), - * creating it if it does not already exist. - * - *

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

- */ - public Item getItemFirstRep() { - if (getItem().isEmpty()) { - return addItem(); - } - return getItem().get(0); - } - - /** - * Block class for child element: DiagnosticOrder.event (A list of events of interest in the lifecycle) - * - *

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

- */ - @Block() - public static class Event extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="status", type=CodeDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="requested | received | accepted | in progress | review | completed | suspended | rejected | failed", - formalDefinition="The status for the event" - ) - private BoundCodeDt myStatus; - - @Child(name="description", type=CodeableConceptDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="More information about the event and it's context", - formalDefinition="Additional information about the event that occurred - e.g. if the status remained unchanged" - ) - private CodeableConceptDt myDescription; - - @Child(name="dateTime", type=DateTimeDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="The date at which the event happened", - formalDefinition="The date/time at which the event occurred" - ) - private DateTimeDt myDateTime; - - @Child(name="actor", order=3, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Device.class }) - @Description( - shortDefinition="Who recorded or did this", - formalDefinition="The person who was responsible for performing or recording the action" - ) - private ResourceReferenceDt myActor; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myStatus, myDescription, myDateTime, myActor); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myStatus, myDescription, myDateTime, myActor); - } - - /** - * Gets the value(s) for status (requested | received | accepted | in progress | review | completed | suspended | rejected | failed). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The status for the event - *

- */ - public BoundCodeDt getStatus() { - if (myStatus == null) { - myStatus = new BoundCodeDt(DiagnosticOrderStatusEnum.VALUESET_BINDER); - } - return myStatus; - } - - /** - * Sets the value(s) for status (requested | received | accepted | in progress | review | completed | suspended | rejected | failed) - * - *

- * Definition: - * The status for the event - *

- */ - public Event setStatus(BoundCodeDt theValue) { - myStatus = theValue; - return this; - } - - /** - * Sets the value(s) for status (requested | received | accepted | in progress | review | completed | suspended | rejected | failed) - * - *

- * Definition: - * The status for the event - *

- */ - public Event setStatus(DiagnosticOrderStatusEnum theValue) { - getStatus().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for description (More information about the event and it's context). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Additional information about the event that occurred - e.g. if the status remained unchanged - *

- */ - public CodeableConceptDt getDescription() { - if (myDescription == null) { - myDescription = new CodeableConceptDt(); - } - return myDescription; - } - - /** - * Sets the value(s) for description (More information about the event and it's context) - * - *

- * Definition: - * Additional information about the event that occurred - e.g. if the status remained unchanged - *

- */ - public Event setDescription(CodeableConceptDt theValue) { - myDescription = theValue; - return this; - } - - - /** - * Gets the value(s) for dateTime (The date at which the event happened). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The date/time at which the event occurred - *

- */ - public DateTimeDt getDateTime() { - if (myDateTime == null) { - myDateTime = new DateTimeDt(); - } - return myDateTime; - } - - /** - * Sets the value(s) for dateTime (The date at which the event happened) - * - *

- * Definition: - * The date/time at which the event occurred - *

- */ - public Event setDateTime(DateTimeDt theValue) { - myDateTime = theValue; - return this; - } - - /** - * Sets the value for dateTime (The date at which the event happened) - * - *

- * Definition: - * The date/time at which the event occurred - *

- */ - public Event setDateTimeWithSecondsPrecision( Date theDate) { - myDateTime = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for dateTime (The date at which the event happened) - * - *

- * Definition: - * The date/time at which the event occurred - *

- */ - public Event setDateTime( Date theDate, TemporalPrecisionEnum thePrecision) { - myDateTime = new DateTimeDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for actor (Who recorded or did this). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The person who was responsible for performing or recording the action - *

- */ - public ResourceReferenceDt getActor() { - if (myActor == null) { - myActor = new ResourceReferenceDt(); - } - return myActor; - } - - /** - * Sets the value(s) for actor (Who recorded or did this) - * - *

- * Definition: - * The person who was responsible for performing or recording the action - *

- */ - public Event setActor(ResourceReferenceDt theValue) { - myActor = theValue; - return this; - } - - - - } - - - /** - * Block class for child element: DiagnosticOrder.item (The items the orderer requested) - * - *

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

- */ - @Block() - public static class Item extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="code", type=CodeableConceptDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Code to indicate the item (test or panel) being ordered", - formalDefinition="A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested" - ) - private CodeableConceptDt myCode; - - @Child(name="specimen", order=1, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Specimen.class }) - @Description( - shortDefinition="If this item relates to specific specimens", - formalDefinition="If the item is related to a specific speciment" - ) - private java.util.List mySpecimen; - - @Child(name="bodySite", type=CodeableConceptDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Location of requested test (if applicable)", - formalDefinition="Anatomical location where the request test should be performed" - ) - private CodeableConceptDt myBodySite; - - @Child(name="status", type=CodeDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="requested | received | accepted | in progress | review | completed | suspended | rejected | failed", - formalDefinition="The status of this individual item within the order" - ) - private BoundCodeDt myStatus; - - @Child(name="event", type=Event.class, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Events specific to this item", - formalDefinition="A summary of the events of interest that have occurred as this item of the request is processed" - ) - private java.util.List myEvent; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCode, mySpecimen, myBodySite, myStatus, myEvent); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCode, mySpecimen, myBodySite, myStatus, myEvent); - } - - /** - * Gets the value(s) for code (Code to indicate the item (test or panel) being ordered). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested - *

- */ - public CodeableConceptDt getCode() { - if (myCode == null) { - myCode = new CodeableConceptDt(); - } - return myCode; - } - - /** - * Sets the value(s) for code (Code to indicate the item (test or panel) being ordered) - * - *

- * Definition: - * A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested - *

- */ - public Item setCode(CodeableConceptDt theValue) { - myCode = theValue; - return this; - } - - - /** - * Gets the value(s) for specimen (If this item relates to specific specimens). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getSpecimen() { - if (mySpecimen == null) { - mySpecimen = new java.util.ArrayList(); - } - return mySpecimen; - } - - /** - * Sets the value(s) for specimen (If this item relates to specific specimens) - * - *

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

- */ - public Item setSpecimen(java.util.List theValue) { - mySpecimen = theValue; - return this; - } - - /** - * Adds and returns a new value for specimen (If this item relates to specific specimens) - * - *

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

- */ - public ResourceReferenceDt addSpecimen() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getSpecimen().add(newType); - return newType; - } - - /** - * Gets the value(s) for bodySite (Location of requested test (if applicable)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Anatomical location where the request test should be performed - *

- */ - public CodeableConceptDt getBodySite() { - if (myBodySite == null) { - myBodySite = new CodeableConceptDt(); - } - return myBodySite; - } - - /** - * Sets the value(s) for bodySite (Location of requested test (if applicable)) - * - *

- * Definition: - * Anatomical location where the request test should be performed - *

- */ - public Item setBodySite(CodeableConceptDt theValue) { - myBodySite = theValue; - return this; - } - - - /** - * Gets the value(s) for status (requested | received | accepted | in progress | review | completed | suspended | rejected | failed). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The status of this individual item within the order - *

- */ - public BoundCodeDt getStatus() { - if (myStatus == null) { - myStatus = new BoundCodeDt(DiagnosticOrderStatusEnum.VALUESET_BINDER); - } - return myStatus; - } - - /** - * Sets the value(s) for status (requested | received | accepted | in progress | review | completed | suspended | rejected | failed) - * - *

- * Definition: - * The status of this individual item within the order - *

- */ - public Item setStatus(BoundCodeDt theValue) { - myStatus = theValue; - return this; - } - - /** - * Sets the value(s) for status (requested | received | accepted | in progress | review | completed | suspended | rejected | failed) - * - *

- * Definition: - * The status of this individual item within the order - *

- */ - public Item setStatus(DiagnosticOrderStatusEnum theValue) { - getStatus().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for event (Events specific to this item). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getEvent() { - if (myEvent == null) { - myEvent = new java.util.ArrayList(); - } - return myEvent; - } - - /** - * Sets the value(s) for event (Events specific to this item) - * - *

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

- */ - public Item setEvent(java.util.List theValue) { - myEvent = theValue; - return this; - } - - /** - * Adds and returns a new value for event (Events specific to this item) - * - *

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

- */ - public Event addEvent() { - Event newType = new Event(); - getEvent().add(newType); - return newType; - } - - /** - * Gets the first repetition for event (Events specific to this item), - * creating it if it does not already exist. - * - *

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

- */ - public Event getEventFirstRep() { - if (getEvent().isEmpty()) { - return addEvent(); - } - return getEvent().get(0); - } - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DiagnosticReport.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DiagnosticReport.java deleted file mode 100644 index 213ab9bf89e..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DiagnosticReport.java +++ /dev/null @@ -1,1363 +0,0 @@ - - - - - - - - - - - - - - - - -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.AttachmentDt; -import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.DiagnosticReportStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -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.StringDt; -import ca.uhn.fhir.rest.gclient.DateClientParam; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR DiagnosticReport Resource - * (A Diagnostic report - a combination of request information, atomic results, images, interpretation, as well as formatted reports) - * - *

- * Definition: - * The findings and interpretation of diagnostic tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretation, and formatted representation of diagnostic reports - *

- * - *

- * Requirements: - * To support reporting for any diagnostic report into a clinical data repository. - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/DiagnosticReport - *

- * - */ -@ResourceDef(name="DiagnosticReport", profile="http://hl7.org/fhir/profiles/DiagnosticReport", id="diagnosticreport") -public class DiagnosticReport extends BaseResource implements IResource { - - /** - * Search parameter constant for status - *

- * Description: The status of the report
- * Type: token
- * Path: DiagnosticReport.status
- *

- */ - @SearchParamDefinition(name="status", path="DiagnosticReport.status", description="The status of the report", type="token" ) - public static final String SP_STATUS = "status"; - - /** - * Fluent Client search parameter constant for status - *

- * Description: The status of the report
- * Type: token
- * Path: DiagnosticReport.status
- *

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

- * Description: When the report was issued
- * Type: date
- * Path: DiagnosticReport.issued
- *

- */ - @SearchParamDefinition(name="issued", path="DiagnosticReport.issued", description="When the report was issued", type="date" ) - public static final String SP_ISSUED = "issued"; - - /** - * Fluent Client search parameter constant for issued - *

- * Description: When the report was issued
- * Type: date
- * Path: DiagnosticReport.issued
- *

- */ - public static final DateClientParam ISSUED = new DateClientParam(SP_ISSUED); - - /** - * Search parameter constant for subject - *

- * Description: The subject of the report
- * Type: reference
- * Path: DiagnosticReport.subject
- *

- */ - @SearchParamDefinition(name="subject", path="DiagnosticReport.subject", description="The subject of the report", type="reference" ) - public static final String SP_SUBJECT = "subject"; - - /** - * Fluent Client search parameter constant for subject - *

- * Description: The subject of the report
- * Type: reference
- * Path: DiagnosticReport.subject
- *

- */ - public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DiagnosticReport.subject". - */ - public static final Include INCLUDE_SUBJECT = new Include("DiagnosticReport.subject"); - - /** - * Search parameter constant for performer - *

- * Description: Who was the source of the report (organization)
- * Type: reference
- * Path: DiagnosticReport.performer
- *

- */ - @SearchParamDefinition(name="performer", path="DiagnosticReport.performer", description="Who was the source of the report (organization)", type="reference" ) - public static final String SP_PERFORMER = "performer"; - - /** - * Fluent Client search parameter constant for performer - *

- * Description: Who was the source of the report (organization)
- * Type: reference
- * Path: DiagnosticReport.performer
- *

- */ - public static final ReferenceClientParam PERFORMER = new ReferenceClientParam(SP_PERFORMER); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DiagnosticReport.performer". - */ - public static final Include INCLUDE_PERFORMER = new Include("DiagnosticReport.performer"); - - /** - * Search parameter constant for identifier - *

- * Description: An identifier for the report
- * Type: token
- * Path: DiagnosticReport.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="DiagnosticReport.identifier", description="An identifier for the report", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - - /** - * Fluent Client search parameter constant for identifier - *

- * Description: An identifier for the report
- * Type: token
- * Path: DiagnosticReport.identifier
- *

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

- * Description: Which diagnostic discipline/department created the report
- * Type: token
- * Path: DiagnosticReport.serviceCategory
- *

- */ - @SearchParamDefinition(name="service", path="DiagnosticReport.serviceCategory", description="Which diagnostic discipline/department created the report", type="token" ) - public static final String SP_SERVICE = "service"; - - /** - * Fluent Client search parameter constant for service - *

- * Description: Which diagnostic discipline/department created the report
- * Type: token
- * Path: DiagnosticReport.serviceCategory
- *

- */ - public static final TokenClientParam SERVICE = new TokenClientParam(SP_SERVICE); - - /** - * Search parameter constant for date - *

- * Description: The clinically relevant time of the report
- * Type: date
- * Path: DiagnosticReport.diagnostic[x]
- *

- */ - @SearchParamDefinition(name="date", path="DiagnosticReport.diagnostic[x]", description="The clinically relevant time of the report", type="date" ) - public static final String SP_DATE = "date"; - - /** - * Fluent Client search parameter constant for date - *

- * Description: The clinically relevant time of the report
- * Type: date
- * Path: DiagnosticReport.diagnostic[x]
- *

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

- * Description: The specimen details
- * Type: reference
- * Path: DiagnosticReport.specimen
- *

- */ - @SearchParamDefinition(name="specimen", path="DiagnosticReport.specimen", description="The specimen details", type="reference" ) - public static final String SP_SPECIMEN = "specimen"; - - /** - * Fluent Client search parameter constant for specimen - *

- * Description: The specimen details
- * Type: reference
- * Path: DiagnosticReport.specimen
- *

- */ - public static final ReferenceClientParam SPECIMEN = new ReferenceClientParam(SP_SPECIMEN); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DiagnosticReport.specimen". - */ - public static final Include INCLUDE_SPECIMEN = new Include("DiagnosticReport.specimen"); - - /** - * Search parameter constant for name - *

- * Description: The name of the report (e.g. the code for the report as a whole, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result)
- * Type: token
- * Path: DiagnosticReport.name
- *

- */ - @SearchParamDefinition(name="name", path="DiagnosticReport.name", description="The name of the report (e.g. the code for the report as a whole, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result)", type="token" ) - public static final String SP_NAME = "name"; - - /** - * Fluent Client search parameter constant for name - *

- * Description: The name of the report (e.g. the code for the report as a whole, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result)
- * Type: token
- * Path: DiagnosticReport.name
- *

- */ - public static final TokenClientParam NAME = new TokenClientParam(SP_NAME); - - /** - * Search parameter constant for result - *

- * Description: Link to an atomic result (observation resource)
- * Type: reference
- * Path: DiagnosticReport.result
- *

- */ - @SearchParamDefinition(name="result", path="DiagnosticReport.result", description="Link to an atomic result (observation resource)", type="reference" ) - public static final String SP_RESULT = "result"; - - /** - * Fluent Client search parameter constant for result - *

- * Description: Link to an atomic result (observation resource)
- * Type: reference
- * Path: DiagnosticReport.result
- *

- */ - public static final ReferenceClientParam RESULT = new ReferenceClientParam(SP_RESULT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DiagnosticReport.result". - */ - public static final Include INCLUDE_RESULT = new Include("DiagnosticReport.result"); - - /** - * Search parameter constant for diagnosis - *

- * Description: A coded diagnosis on the report
- * Type: token
- * Path: DiagnosticReport.codedDiagnosis
- *

- */ - @SearchParamDefinition(name="diagnosis", path="DiagnosticReport.codedDiagnosis", description="A coded diagnosis on the report", type="token" ) - public static final String SP_DIAGNOSIS = "diagnosis"; - - /** - * Fluent Client search parameter constant for diagnosis - *

- * Description: A coded diagnosis on the report
- * Type: token
- * Path: DiagnosticReport.codedDiagnosis
- *

- */ - public static final TokenClientParam DIAGNOSIS = new TokenClientParam(SP_DIAGNOSIS); - - /** - * Search parameter constant for image - *

- * Description:
- * Type: reference
- * Path: DiagnosticReport.image.link
- *

- */ - @SearchParamDefinition(name="image", path="DiagnosticReport.image.link", description="", type="reference" ) - public static final String SP_IMAGE = "image"; - - /** - * Fluent Client search parameter constant for image - *

- * Description:
- * Type: reference
- * Path: DiagnosticReport.image.link
- *

- */ - public static final ReferenceClientParam IMAGE = new ReferenceClientParam(SP_IMAGE); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DiagnosticReport.image.link". - */ - public static final Include INCLUDE_IMAGE_LINK = new Include("DiagnosticReport.image.link"); - - /** - * Search parameter constant for request - *

- * Description:
- * Type: reference
- * Path: DiagnosticReport.requestDetail
- *

- */ - @SearchParamDefinition(name="request", path="DiagnosticReport.requestDetail", description="", type="reference" ) - public static final String SP_REQUEST = "request"; - - /** - * Fluent Client search parameter constant for request - *

- * Description:
- * Type: reference
- * Path: DiagnosticReport.requestDetail
- *

- */ - public static final ReferenceClientParam REQUEST = new ReferenceClientParam(SP_REQUEST); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DiagnosticReport.requestDetail". - */ - public static final Include INCLUDE_REQUESTDETAIL = new Include("DiagnosticReport.requestDetail"); - - - @Child(name="name", type=CodeableConceptDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Name/Code for this diagnostic report", - formalDefinition="A code or name that describes this diagnostic report" - ) - private CodeableConceptDt myName; - - @Child(name="status", type=CodeDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="registered | partial | final | corrected +", - formalDefinition="The status of the diagnostic report as a whole" - ) - private BoundCodeDt myStatus; - - @Child(name="issued", type=DateTimeDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="Date this version was released", - formalDefinition="The date and/or time that this version of the report was released from the source diagnostic service" - ) - private DateTimeDt myIssued; - - @Child(name="subject", order=3, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.Group.class, ca.uhn.fhir.model.dstu.resource.Device.class, ca.uhn.fhir.model.dstu.resource.Location.class }) - @Description( - shortDefinition="The subject of the report, usually, but not always, the patient", - formalDefinition="The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources" - ) - private ResourceReferenceDt mySubject; - - @Child(name="performer", order=4, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Organization.class }) - @Description( - shortDefinition="Responsible Diagnostic Service", - formalDefinition="The diagnostic service that is responsible for issuing the report" - ) - private ResourceReferenceDt myPerformer; - - @Child(name="identifier", type=IdentifierDt.class, order=5, min=0, max=1) - @Description( - shortDefinition="Id for external references to this report", - formalDefinition="The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider" - ) - private IdentifierDt myIdentifier; - - @Child(name="requestDetail", order=6, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.DiagnosticOrder.class }) - @Description( - shortDefinition="What was requested", - formalDefinition="Details concerning a test requested." - ) - private java.util.List myRequestDetail; - - @Child(name="serviceCategory", type=CodeableConceptDt.class, order=7, min=0, max=1) - @Description( - shortDefinition="Biochemistry, Hematology etc.", - formalDefinition="The section of the diagnostic service that performs the examination e.g. biochemistry, hematology, MRI" - ) - private CodeableConceptDt myServiceCategory; - - @Child(name="diagnostic", order=8, min=1, max=1, type={ - DateTimeDt.class, PeriodDt.class }) - @Description( - shortDefinition="Physiologically Relevant time/time-period for report", - formalDefinition="The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself" - ) - private IDatatype myDiagnostic; - - @Child(name="specimen", order=9, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Specimen.class }) - @Description( - shortDefinition="Specimens this report is based on", - formalDefinition="Details about the specimens on which this Disagnostic report is based" - ) - private java.util.List mySpecimen; - - @Child(name="result", order=10, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Observation.class }) - @Description( - shortDefinition="Observations - simple, or complex nested groups", - formalDefinition="Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. \"atomic\" results), or they can be grouping observations that include references to other members of the group (e.g. \"panels\")" - ) - private java.util.List myResult; - - @Child(name="imagingStudy", order=11, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.ImagingStudy.class }) - @Description( - shortDefinition="Reference to full details of imaging associated with the diagnostic report", - formalDefinition="One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images" - ) - private java.util.List myImagingStudy; - - @Child(name="image", order=12, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Key images associated with this report", - formalDefinition="A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest)" - ) - private java.util.List myImage; - - @Child(name="conclusion", type=StringDt.class, order=13, min=0, max=1) - @Description( - shortDefinition="Clinical Interpretation of test results", - formalDefinition="Concise and clinically contextualized narrative interpretation of the diagnostic report" - ) - private StringDt myConclusion; - - @Child(name="codedDiagnosis", type=CodeableConceptDt.class, order=14, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Codes for the conclusion", - formalDefinition="" - ) - private java.util.List myCodedDiagnosis; - - @Child(name="presentedForm", type=AttachmentDt.class, order=15, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Entire Report as issued", - formalDefinition="Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent." - ) - private java.util.List myPresentedForm; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myName, myStatus, myIssued, mySubject, myPerformer, myIdentifier, myRequestDetail, myServiceCategory, myDiagnostic, mySpecimen, myResult, myImagingStudy, myImage, myConclusion, myCodedDiagnosis, myPresentedForm); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myName, myStatus, myIssued, mySubject, myPerformer, myIdentifier, myRequestDetail, myServiceCategory, myDiagnostic, mySpecimen, myResult, myImagingStudy, myImage, myConclusion, myCodedDiagnosis, myPresentedForm); - } - - /** - * Gets the value(s) for name (Name/Code for this diagnostic report). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A code or name that describes this diagnostic report - *

- */ - public CodeableConceptDt getName() { - if (myName == null) { - myName = new CodeableConceptDt(); - } - return myName; - } - - /** - * Sets the value(s) for name (Name/Code for this diagnostic report) - * - *

- * Definition: - * A code or name that describes this diagnostic report - *

- */ - public DiagnosticReport setName(CodeableConceptDt theValue) { - myName = theValue; - return this; - } - - - /** - * Gets the value(s) for status (registered | partial | final | corrected +). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The status of the diagnostic report as a whole - *

- */ - public BoundCodeDt getStatus() { - if (myStatus == null) { - myStatus = new BoundCodeDt(DiagnosticReportStatusEnum.VALUESET_BINDER); - } - return myStatus; - } - - /** - * Sets the value(s) for status (registered | partial | final | corrected +) - * - *

- * Definition: - * The status of the diagnostic report as a whole - *

- */ - public DiagnosticReport setStatus(BoundCodeDt theValue) { - myStatus = theValue; - return this; - } - - /** - * Sets the value(s) for status (registered | partial | final | corrected +) - * - *

- * Definition: - * The status of the diagnostic report as a whole - *

- */ - public DiagnosticReport setStatus(DiagnosticReportStatusEnum theValue) { - getStatus().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for issued (Date this version was released). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The date and/or time that this version of the report was released from the source diagnostic service - *

- */ - public DateTimeDt getIssued() { - if (myIssued == null) { - myIssued = new DateTimeDt(); - } - return myIssued; - } - - /** - * Sets the value(s) for issued (Date this version was released) - * - *

- * Definition: - * The date and/or time that this version of the report was released from the source diagnostic service - *

- */ - public DiagnosticReport setIssued(DateTimeDt theValue) { - myIssued = theValue; - return this; - } - - /** - * Sets the value for issued (Date this version was released) - * - *

- * Definition: - * The date and/or time that this version of the report was released from the source diagnostic service - *

- */ - public DiagnosticReport setIssuedWithSecondsPrecision( Date theDate) { - myIssued = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for issued (Date this version was released) - * - *

- * Definition: - * The date and/or time that this version of the report was released from the source diagnostic service - *

- */ - public DiagnosticReport setIssued( Date theDate, TemporalPrecisionEnum thePrecision) { - myIssued = new DateTimeDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for subject (The subject of the report, usually, but not always, the patient). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources - *

- */ - public ResourceReferenceDt getSubject() { - if (mySubject == null) { - mySubject = new ResourceReferenceDt(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (The subject of the report, usually, but not always, the patient) - * - *

- * Definition: - * The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources - *

- */ - public DiagnosticReport setSubject(ResourceReferenceDt theValue) { - mySubject = theValue; - return this; - } - - - /** - * Gets the value(s) for performer (Responsible Diagnostic Service). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The diagnostic service that is responsible for issuing the report - *

- */ - public ResourceReferenceDt getPerformer() { - if (myPerformer == null) { - myPerformer = new ResourceReferenceDt(); - } - return myPerformer; - } - - /** - * Sets the value(s) for performer (Responsible Diagnostic Service) - * - *

- * Definition: - * The diagnostic service that is responsible for issuing the report - *

- */ - public DiagnosticReport setPerformer(ResourceReferenceDt theValue) { - myPerformer = theValue; - return this; - } - - - /** - * Gets the value(s) for identifier (Id for external references to this report). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider - *

- */ - public IdentifierDt getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new IdentifierDt(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Id for external references to this report) - * - *

- * Definition: - * The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider - *

- */ - public DiagnosticReport setIdentifier(IdentifierDt theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Sets the value for identifier (Id for external references to this report) - * - *

- * Definition: - * The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider - *

- */ - public DiagnosticReport setIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - myIdentifier = new IdentifierDt(theUse, theSystem, theValue, theLabel); - return this; - } - - /** - * Sets the value for identifier (Id for external references to this report) - * - *

- * Definition: - * The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider - *

- */ - public DiagnosticReport setIdentifier( String theSystem, String theValue) { - myIdentifier = new IdentifierDt(theSystem, theValue); - return this; - } - - - /** - * Gets the value(s) for requestDetail (What was requested). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Details concerning a test requested. - *

- */ - public java.util.List getRequestDetail() { - if (myRequestDetail == null) { - myRequestDetail = new java.util.ArrayList(); - } - return myRequestDetail; - } - - /** - * Sets the value(s) for requestDetail (What was requested) - * - *

- * Definition: - * Details concerning a test requested. - *

- */ - public DiagnosticReport setRequestDetail(java.util.List theValue) { - myRequestDetail = theValue; - return this; - } - - /** - * Adds and returns a new value for requestDetail (What was requested) - * - *

- * Definition: - * Details concerning a test requested. - *

- */ - public ResourceReferenceDt addRequestDetail() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getRequestDetail().add(newType); - return newType; - } - - /** - * Gets the value(s) for serviceCategory (Biochemistry, Hematology etc.). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The section of the diagnostic service that performs the examination e.g. biochemistry, hematology, MRI - *

- */ - public CodeableConceptDt getServiceCategory() { - if (myServiceCategory == null) { - myServiceCategory = new CodeableConceptDt(); - } - return myServiceCategory; - } - - /** - * Sets the value(s) for serviceCategory (Biochemistry, Hematology etc.) - * - *

- * Definition: - * The section of the diagnostic service that performs the examination e.g. biochemistry, hematology, MRI - *

- */ - public DiagnosticReport setServiceCategory(CodeableConceptDt theValue) { - myServiceCategory = theValue; - return this; - } - - - /** - * Gets the value(s) for diagnostic[x] (Physiologically Relevant time/time-period for report). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself - *

- */ - public IDatatype getDiagnostic() { - return myDiagnostic; - } - - /** - * Sets the value(s) for diagnostic[x] (Physiologically Relevant time/time-period for report) - * - *

- * Definition: - * The time or time-period the observed values are related to. This is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself - *

- */ - public DiagnosticReport setDiagnostic(IDatatype theValue) { - myDiagnostic = theValue; - return this; - } - - - /** - * Gets the value(s) for specimen (Specimens this report is based on). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Details about the specimens on which this Disagnostic report is based - *

- */ - public java.util.List getSpecimen() { - if (mySpecimen == null) { - mySpecimen = new java.util.ArrayList(); - } - return mySpecimen; - } - - /** - * Sets the value(s) for specimen (Specimens this report is based on) - * - *

- * Definition: - * Details about the specimens on which this Disagnostic report is based - *

- */ - public DiagnosticReport setSpecimen(java.util.List theValue) { - mySpecimen = theValue; - return this; - } - - /** - * Adds and returns a new value for specimen (Specimens this report is based on) - * - *

- * Definition: - * Details about the specimens on which this Disagnostic report is based - *

- */ - public ResourceReferenceDt addSpecimen() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getSpecimen().add(newType); - return newType; - } - - /** - * Gets the value(s) for result (Observations - simple, or complex nested groups). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. \"atomic\" results), or they can be grouping observations that include references to other members of the group (e.g. \"panels\") - *

- */ - public java.util.List getResult() { - if (myResult == null) { - myResult = new java.util.ArrayList(); - } - return myResult; - } - - /** - * Sets the value(s) for result (Observations - simple, or complex nested groups) - * - *

- * Definition: - * Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. \"atomic\" results), or they can be grouping observations that include references to other members of the group (e.g. \"panels\") - *

- */ - public DiagnosticReport setResult(java.util.List theValue) { - myResult = theValue; - return this; - } - - /** - * Adds and returns a new value for result (Observations - simple, or complex nested groups) - * - *

- * Definition: - * Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. \"atomic\" results), or they can be grouping observations that include references to other members of the group (e.g. \"panels\") - *

- */ - public ResourceReferenceDt addResult() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getResult().add(newType); - return newType; - } - - /** - * Gets the value(s) for imagingStudy (Reference to full details of imaging associated with the diagnostic report). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images - *

- */ - public java.util.List getImagingStudy() { - if (myImagingStudy == null) { - myImagingStudy = new java.util.ArrayList(); - } - return myImagingStudy; - } - - /** - * Sets the value(s) for imagingStudy (Reference to full details of imaging associated with the diagnostic report) - * - *

- * Definition: - * One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images - *

- */ - public DiagnosticReport setImagingStudy(java.util.List theValue) { - myImagingStudy = theValue; - return this; - } - - /** - * Adds and returns a new value for imagingStudy (Reference to full details of imaging associated with the diagnostic report) - * - *

- * Definition: - * One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images - *

- */ - public ResourceReferenceDt addImagingStudy() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getImagingStudy().add(newType); - return newType; - } - - /** - * Gets the value(s) for image (Key images associated with this report). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getImage() { - if (myImage == null) { - myImage = new java.util.ArrayList(); - } - return myImage; - } - - /** - * Sets the value(s) for image (Key images associated with this report) - * - *

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

- */ - public DiagnosticReport setImage(java.util.List theValue) { - myImage = theValue; - return this; - } - - /** - * Adds and returns a new value for image (Key images associated with this report) - * - *

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

- */ - public Image addImage() { - Image newType = new Image(); - getImage().add(newType); - return newType; - } - - /** - * Gets the first repetition for image (Key images associated with this report), - * creating it if it does not already exist. - * - *

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

- */ - public Image getImageFirstRep() { - if (getImage().isEmpty()) { - return addImage(); - } - return getImage().get(0); - } - - /** - * Gets the value(s) for conclusion (Clinical Interpretation of test results). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Concise and clinically contextualized narrative interpretation of the diagnostic report - *

- */ - public StringDt getConclusion() { - if (myConclusion == null) { - myConclusion = new StringDt(); - } - return myConclusion; - } - - /** - * Sets the value(s) for conclusion (Clinical Interpretation of test results) - * - *

- * Definition: - * Concise and clinically contextualized narrative interpretation of the diagnostic report - *

- */ - public DiagnosticReport setConclusion(StringDt theValue) { - myConclusion = theValue; - return this; - } - - /** - * Sets the value for conclusion (Clinical Interpretation of test results) - * - *

- * Definition: - * Concise and clinically contextualized narrative interpretation of the diagnostic report - *

- */ - public DiagnosticReport setConclusion( String theString) { - myConclusion = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for codedDiagnosis (Codes for the conclusion). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getCodedDiagnosis() { - if (myCodedDiagnosis == null) { - myCodedDiagnosis = new java.util.ArrayList(); - } - return myCodedDiagnosis; - } - - /** - * Sets the value(s) for codedDiagnosis (Codes for the conclusion) - * - *

- * Definition: - * - *

- */ - public DiagnosticReport setCodedDiagnosis(java.util.List theValue) { - myCodedDiagnosis = theValue; - return this; - } - - /** - * Adds and returns a new value for codedDiagnosis (Codes for the conclusion) - * - *

- * Definition: - * - *

- */ - public CodeableConceptDt addCodedDiagnosis() { - CodeableConceptDt newType = new CodeableConceptDt(); - getCodedDiagnosis().add(newType); - return newType; - } - - /** - * Gets the first repetition for codedDiagnosis (Codes for the conclusion), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public CodeableConceptDt getCodedDiagnosisFirstRep() { - if (getCodedDiagnosis().isEmpty()) { - return addCodedDiagnosis(); - } - return getCodedDiagnosis().get(0); - } - - /** - * Gets the value(s) for presentedForm (Entire Report as issued). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getPresentedForm() { - if (myPresentedForm == null) { - myPresentedForm = new java.util.ArrayList(); - } - return myPresentedForm; - } - - /** - * Sets the value(s) for presentedForm (Entire Report as issued) - * - *

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

- */ - public DiagnosticReport setPresentedForm(java.util.List theValue) { - myPresentedForm = theValue; - return this; - } - - /** - * Adds and returns a new value for presentedForm (Entire Report as issued) - * - *

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

- */ - public AttachmentDt addPresentedForm() { - AttachmentDt newType = new AttachmentDt(); - getPresentedForm().add(newType); - return newType; - } - - /** - * Gets the first repetition for presentedForm (Entire Report as issued), - * creating it if it does not already exist. - * - *

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

- */ - public AttachmentDt getPresentedFormFirstRep() { - if (getPresentedForm().isEmpty()) { - return addPresentedForm(); - } - return getPresentedForm().get(0); - } - - /** - * Block class for child element: DiagnosticReport.image (Key images associated with this report) - * - *

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

- */ - @Block() - public static class Image extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="comment", type=StringDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Comment about the image (e.g. explanation)", - formalDefinition="A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features" - ) - private StringDt myComment; - - @Child(name="link", order=1, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Media.class }) - @Description( - shortDefinition="Reference to the image source", - formalDefinition="" - ) - private ResourceReferenceDt myLink; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myComment, myLink); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myComment, myLink); - } - - /** - * Gets the value(s) for comment (Comment about the image (e.g. explanation)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features - *

- */ - public StringDt getComment() { - if (myComment == null) { - myComment = new StringDt(); - } - return myComment; - } - - /** - * Sets the value(s) for comment (Comment about the image (e.g. explanation)) - * - *

- * Definition: - * A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features - *

- */ - public Image setComment(StringDt theValue) { - myComment = theValue; - return this; - } - - /** - * Sets the value for comment (Comment about the image (e.g. explanation)) - * - *

- * Definition: - * A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features - *

- */ - public Image setComment( String theString) { - myComment = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for link (Reference to the image source). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt getLink() { - if (myLink == null) { - myLink = new ResourceReferenceDt(); - } - return myLink; - } - - /** - * Sets the value(s) for link (Reference to the image source) - * - *

- * Definition: - * - *

- */ - public Image setLink(ResourceReferenceDt theValue) { - myLink = theValue; - return this; - } - - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DocumentManifest.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DocumentManifest.java deleted file mode 100644 index b4fb4903a32..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DocumentManifest.java +++ /dev/null @@ -1,1073 +0,0 @@ - - - - - - - - - - - - - - - - -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.BaseResource; -import ca.uhn.fhir.model.api.IElement; -import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.api.Include; -import ca.uhn.fhir.model.api.TemporalPrecisionEnum; -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.Description; -import ca.uhn.fhir.model.api.annotation.ResourceDef; -import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; -import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.DocumentReferenceStatusEnum; -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.DateTimeDt; -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 DocumentManifest Resource - * (A manifest that defines a set of documents) - * - *

- * Definition: - * A manifest that defines a set of documents - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/DocumentManifest - *

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

- * Description:
- * Type: token
- * Path: DocumentManifest.masterIdentifier | DocumentManifest.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="DocumentManifest.masterIdentifier | DocumentManifest.identifier", description="", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - - /** - * Fluent Client search parameter constant for identifier - *

- * Description:
- * Type: token
- * Path: DocumentManifest.masterIdentifier | DocumentManifest.identifier
- *

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

- * Description:
- * Type: reference
- * Path: DocumentManifest.subject
- *

- */ - @SearchParamDefinition(name="subject", path="DocumentManifest.subject", description="", type="reference" ) - public static final String SP_SUBJECT = "subject"; - - /** - * Fluent Client search parameter constant for subject - *

- * Description:
- * Type: reference
- * Path: DocumentManifest.subject
- *

- */ - public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DocumentManifest.subject". - */ - public static final Include INCLUDE_SUBJECT = new Include("DocumentManifest.subject"); - - /** - * Search parameter constant for type - *

- * Description:
- * Type: token
- * Path: DocumentManifest.type
- *

- */ - @SearchParamDefinition(name="type", path="DocumentManifest.type", description="", type="token" ) - public static final String SP_TYPE = "type"; - - /** - * Fluent Client search parameter constant for type - *

- * Description:
- * Type: token
- * Path: DocumentManifest.type
- *

- */ - public static final TokenClientParam TYPE = new TokenClientParam(SP_TYPE); - - /** - * Search parameter constant for recipient - *

- * Description:
- * Type: reference
- * Path: DocumentManifest.recipient
- *

- */ - @SearchParamDefinition(name="recipient", path="DocumentManifest.recipient", description="", type="reference" ) - public static final String SP_RECIPIENT = "recipient"; - - /** - * Fluent Client search parameter constant for recipient - *

- * Description:
- * Type: reference
- * Path: DocumentManifest.recipient
- *

- */ - public static final ReferenceClientParam RECIPIENT = new ReferenceClientParam(SP_RECIPIENT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DocumentManifest.recipient". - */ - public static final Include INCLUDE_RECIPIENT = new Include("DocumentManifest.recipient"); - - /** - * Search parameter constant for author - *

- * Description:
- * Type: reference
- * Path: DocumentManifest.author
- *

- */ - @SearchParamDefinition(name="author", path="DocumentManifest.author", description="", type="reference" ) - public static final String SP_AUTHOR = "author"; - - /** - * Fluent Client search parameter constant for author - *

- * Description:
- * Type: reference
- * Path: DocumentManifest.author
- *

- */ - public static final ReferenceClientParam AUTHOR = new ReferenceClientParam(SP_AUTHOR); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DocumentManifest.author". - */ - public static final Include INCLUDE_AUTHOR = new Include("DocumentManifest.author"); - - /** - * Search parameter constant for created - *

- * Description:
- * Type: date
- * Path: DocumentManifest.created
- *

- */ - @SearchParamDefinition(name="created", path="DocumentManifest.created", description="", type="date" ) - public static final String SP_CREATED = "created"; - - /** - * Fluent Client search parameter constant for created - *

- * Description:
- * Type: date
- * Path: DocumentManifest.created
- *

- */ - public static final DateClientParam CREATED = new DateClientParam(SP_CREATED); - - /** - * Search parameter constant for status - *

- * Description:
- * Type: token
- * Path: DocumentManifest.status
- *

- */ - @SearchParamDefinition(name="status", path="DocumentManifest.status", description="", type="token" ) - public static final String SP_STATUS = "status"; - - /** - * Fluent Client search parameter constant for status - *

- * Description:
- * Type: token
- * Path: DocumentManifest.status
- *

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

- * Description:
- * Type: reference
- * Path: DocumentManifest.supercedes
- *

- */ - @SearchParamDefinition(name="supersedes", path="DocumentManifest.supercedes", description="", type="reference" ) - public static final String SP_SUPERSEDES = "supersedes"; - - /** - * Fluent Client search parameter constant for supersedes - *

- * Description:
- * Type: reference
- * Path: DocumentManifest.supercedes
- *

- */ - public static final ReferenceClientParam SUPERSEDES = new ReferenceClientParam(SP_SUPERSEDES); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DocumentManifest.supercedes". - */ - public static final Include INCLUDE_SUPERCEDES = new Include("DocumentManifest.supercedes"); - - /** - * Search parameter constant for description - *

- * Description:
- * Type: string
- * Path: DocumentManifest.description
- *

- */ - @SearchParamDefinition(name="description", path="DocumentManifest.description", description="", type="string" ) - public static final String SP_DESCRIPTION = "description"; - - /** - * Fluent Client search parameter constant for description - *

- * Description:
- * Type: string
- * Path: DocumentManifest.description
- *

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

- * Description:
- * Type: token
- * Path: DocumentManifest.confidentiality
- *

- */ - @SearchParamDefinition(name="confidentiality", path="DocumentManifest.confidentiality", description="", type="token" ) - public static final String SP_CONFIDENTIALITY = "confidentiality"; - - /** - * Fluent Client search parameter constant for confidentiality - *

- * Description:
- * Type: token
- * Path: DocumentManifest.confidentiality
- *

- */ - public static final TokenClientParam CONFIDENTIALITY = new TokenClientParam(SP_CONFIDENTIALITY); - - /** - * Search parameter constant for content - *

- * Description:
- * Type: reference
- * Path: DocumentManifest.content
- *

- */ - @SearchParamDefinition(name="content", path="DocumentManifest.content", description="", type="reference" ) - public static final String SP_CONTENT = "content"; - - /** - * Fluent Client search parameter constant for content - *

- * Description:
- * Type: reference
- * Path: DocumentManifest.content
- *

- */ - public static final ReferenceClientParam CONTENT = new ReferenceClientParam(SP_CONTENT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DocumentManifest.content". - */ - public static final Include INCLUDE_CONTENT = new Include("DocumentManifest.content"); - - - @Child(name="masterIdentifier", type=IdentifierDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Unique Identifier for the set of documents", - formalDefinition="A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts" - ) - private IdentifierDt myMasterIdentifier; - - @Child(name="identifier", type=IdentifierDt.class, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Other identifiers for the manifest", - formalDefinition="Other identifiers associated with the document, including version independent, source record and workflow related identifiers" - ) - private java.util.List myIdentifier; - - @Child(name="subject", order=2, min=1, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Group.class, ca.uhn.fhir.model.dstu.resource.Device.class }) - @Description( - shortDefinition="The subject of the set of documents", - formalDefinition="Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case)" - ) - private java.util.List mySubject; - - @Child(name="recipient", order=3, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Organization.class }) - @Description( - shortDefinition="Intended to get notified about this set of documents", - formalDefinition="A patient, practitioner, or organization for which this set of documents is intended" - ) - private java.util.List myRecipient; - - @Child(name="type", type=CodeableConceptDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="What kind of document set this is", - formalDefinition="Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider" - ) - private CodeableConceptDt myType; - - @Child(name="author", order=5, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Device.class, ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.RelatedPerson.class }) - @Description( - shortDefinition="Who and/or what authored the document", - formalDefinition="Identifies who is responsible for adding the information to the document" - ) - private java.util.List myAuthor; - - @Child(name="created", type=DateTimeDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="When this document manifest created", - formalDefinition="When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated etc)" - ) - private DateTimeDt myCreated; - - @Child(name="source", type=UriDt.class, order=7, min=0, max=1) - @Description( - shortDefinition="The source system/application/software", - formalDefinition="Identifies the source system, application, or software that produced the document manifest" - ) - private UriDt mySource; - - @Child(name="status", type=CodeDt.class, order=8, min=1, max=1) - @Description( - shortDefinition="current | superceded | entered in error", - formalDefinition="The status of this document manifest" - ) - private BoundCodeDt myStatus; - - @Child(name="supercedes", order=9, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.DocumentManifest.class }) - @Description( - shortDefinition="If this document manifest replaces another", - formalDefinition="Whether this document manifest replaces another" - ) - private ResourceReferenceDt mySupercedes; - - @Child(name="description", type=StringDt.class, order=10, min=0, max=1) - @Description( - shortDefinition="Human-readable description (title)", - formalDefinition="Human-readable description of the source document. This is sometimes known as the \"title\"" - ) - private StringDt myDescription; - - @Child(name="confidentiality", type=CodeableConceptDt.class, order=11, min=0, max=1) - @Description( - shortDefinition="Sensitivity of set of documents", - formalDefinition="A code specifying the level of confidentiality of this set of Documents" - ) - private CodeableConceptDt myConfidentiality; - - @Child(name="content", order=12, min=1, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.DocumentReference.class, ca.uhn.fhir.model.dstu.resource.Binary.class, ca.uhn.fhir.model.dstu.resource.Media.class }) - @Description( - shortDefinition="Contents of this set of documents", - formalDefinition="The list of resources that describe the parts of this document reference. Usually, these would be document references, but direct references to binary attachments and images are also allowed" - ) - private java.util.List myContent; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myMasterIdentifier, myIdentifier, mySubject, myRecipient, myType, myAuthor, myCreated, mySource, myStatus, mySupercedes, myDescription, myConfidentiality, myContent); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myMasterIdentifier, myIdentifier, mySubject, myRecipient, myType, myAuthor, myCreated, mySource, myStatus, mySupercedes, myDescription, myConfidentiality, myContent); - } - - /** - * Gets the value(s) for masterIdentifier (Unique Identifier for the set of documents). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts - *

- */ - public IdentifierDt getMasterIdentifier() { - if (myMasterIdentifier == null) { - myMasterIdentifier = new IdentifierDt(); - } - return myMasterIdentifier; - } - - /** - * Sets the value(s) for masterIdentifier (Unique Identifier for the set of documents) - * - *

- * Definition: - * A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts - *

- */ - public DocumentManifest setMasterIdentifier(IdentifierDt theValue) { - myMasterIdentifier = theValue; - return this; - } - - /** - * Sets the value for masterIdentifier (Unique Identifier for the set of documents) - * - *

- * Definition: - * A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts - *

- */ - public DocumentManifest setMasterIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - myMasterIdentifier = new IdentifierDt(theUse, theSystem, theValue, theLabel); - return this; - } - - /** - * Sets the value for masterIdentifier (Unique Identifier for the set of documents) - * - *

- * Definition: - * A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts - *

- */ - public DocumentManifest setMasterIdentifier( String theSystem, String theValue) { - myMasterIdentifier = new IdentifierDt(theSystem, theValue); - return this; - } - - - /** - * Gets the value(s) for identifier (Other identifiers for the manifest). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Other identifiers associated with the document, including version independent, source record and workflow related identifiers - *

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Other identifiers for the manifest) - * - *

- * Definition: - * Other identifiers associated with the document, including version independent, source record and workflow related identifiers - *

- */ - public DocumentManifest setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (Other identifiers for the manifest) - * - *

- * Definition: - * Other identifiers associated with the document, including version independent, source record and workflow related identifiers - *

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (Other identifiers for the manifest), - * creating it if it does not already exist. - * - *

- * Definition: - * Other identifiers associated with the document, including version independent, source record and workflow related identifiers - *

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (Other identifiers for the manifest) - * - *

- * Definition: - * Other identifiers associated with the document, including version independent, source record and workflow related identifiers - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public DocumentManifest addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (Other identifiers for the manifest) - * - *

- * Definition: - * Other identifiers associated with the document, including version independent, source record and workflow related identifiers - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public DocumentManifest addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for subject (The subject of the set of documents). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case) - *

- */ - public java.util.List getSubject() { - if (mySubject == null) { - mySubject = new java.util.ArrayList(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (The subject of the set of documents) - * - *

- * Definition: - * Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case) - *

- */ - public DocumentManifest setSubject(java.util.List theValue) { - mySubject = theValue; - return this; - } - - /** - * Adds and returns a new value for subject (The subject of the set of documents) - * - *

- * Definition: - * Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case) - *

- */ - public ResourceReferenceDt addSubject() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getSubject().add(newType); - return newType; - } - - /** - * Gets the value(s) for recipient (Intended to get notified about this set of documents). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A patient, practitioner, or organization for which this set of documents is intended - *

- */ - public java.util.List getRecipient() { - if (myRecipient == null) { - myRecipient = new java.util.ArrayList(); - } - return myRecipient; - } - - /** - * Sets the value(s) for recipient (Intended to get notified about this set of documents) - * - *

- * Definition: - * A patient, practitioner, or organization for which this set of documents is intended - *

- */ - public DocumentManifest setRecipient(java.util.List theValue) { - myRecipient = theValue; - return this; - } - - /** - * Adds and returns a new value for recipient (Intended to get notified about this set of documents) - * - *

- * Definition: - * A patient, practitioner, or organization for which this set of documents is intended - *

- */ - public ResourceReferenceDt addRecipient() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getRecipient().add(newType); - return newType; - } - - /** - * Gets the value(s) for type (What kind of document set this is). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider - *

- */ - public CodeableConceptDt getType() { - if (myType == null) { - myType = new CodeableConceptDt(); - } - return myType; - } - - /** - * Sets the value(s) for type (What kind of document set this is) - * - *

- * Definition: - * Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider - *

- */ - public DocumentManifest setType(CodeableConceptDt theValue) { - myType = theValue; - return this; - } - - - /** - * Gets the value(s) for author (Who and/or what authored the document). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies who is responsible for adding the information to the document - *

- */ - public java.util.List getAuthor() { - if (myAuthor == null) { - myAuthor = new java.util.ArrayList(); - } - return myAuthor; - } - - /** - * Sets the value(s) for author (Who and/or what authored the document) - * - *

- * Definition: - * Identifies who is responsible for adding the information to the document - *

- */ - public DocumentManifest setAuthor(java.util.List theValue) { - myAuthor = theValue; - return this; - } - - /** - * Adds and returns a new value for author (Who and/or what authored the document) - * - *

- * Definition: - * Identifies who is responsible for adding the information to the document - *

- */ - public ResourceReferenceDt addAuthor() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getAuthor().add(newType); - return newType; - } - - /** - * Gets the value(s) for created (When this document manifest created). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated etc) - *

- */ - public DateTimeDt getCreated() { - if (myCreated == null) { - myCreated = new DateTimeDt(); - } - return myCreated; - } - - /** - * Sets the value(s) for created (When this document manifest created) - * - *

- * Definition: - * When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated etc) - *

- */ - public DocumentManifest setCreated(DateTimeDt theValue) { - myCreated = theValue; - return this; - } - - /** - * Sets the value for created (When this document manifest created) - * - *

- * Definition: - * When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated etc) - *

- */ - public DocumentManifest setCreatedWithSecondsPrecision( Date theDate) { - myCreated = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for created (When this document manifest created) - * - *

- * Definition: - * When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated etc) - *

- */ - public DocumentManifest setCreated( Date theDate, TemporalPrecisionEnum thePrecision) { - myCreated = new DateTimeDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for source (The source system/application/software). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the source system, application, or software that produced the document manifest - *

- */ - public UriDt getSource() { - if (mySource == null) { - mySource = new UriDt(); - } - return mySource; - } - - /** - * Sets the value(s) for source (The source system/application/software) - * - *

- * Definition: - * Identifies the source system, application, or software that produced the document manifest - *

- */ - public DocumentManifest setSource(UriDt theValue) { - mySource = theValue; - return this; - } - - /** - * Sets the value for source (The source system/application/software) - * - *

- * Definition: - * Identifies the source system, application, or software that produced the document manifest - *

- */ - public DocumentManifest setSource( String theUri) { - mySource = new UriDt(theUri); - return this; - } - - - /** - * Gets the value(s) for status (current | superceded | entered in error). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The status of this document manifest - *

- */ - public BoundCodeDt getStatus() { - if (myStatus == null) { - myStatus = new BoundCodeDt(DocumentReferenceStatusEnum.VALUESET_BINDER); - } - return myStatus; - } - - /** - * Sets the value(s) for status (current | superceded | entered in error) - * - *

- * Definition: - * The status of this document manifest - *

- */ - public DocumentManifest setStatus(BoundCodeDt theValue) { - myStatus = theValue; - return this; - } - - /** - * Sets the value(s) for status (current | superceded | entered in error) - * - *

- * Definition: - * The status of this document manifest - *

- */ - public DocumentManifest setStatus(DocumentReferenceStatusEnum theValue) { - getStatus().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for supercedes (If this document manifest replaces another). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Whether this document manifest replaces another - *

- */ - public ResourceReferenceDt getSupercedes() { - if (mySupercedes == null) { - mySupercedes = new ResourceReferenceDt(); - } - return mySupercedes; - } - - /** - * Sets the value(s) for supercedes (If this document manifest replaces another) - * - *

- * Definition: - * Whether this document manifest replaces another - *

- */ - public DocumentManifest setSupercedes(ResourceReferenceDt theValue) { - mySupercedes = theValue; - return this; - } - - - /** - * Gets the value(s) for description (Human-readable description (title)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Human-readable description of the source document. This is sometimes known as the \"title\" - *

- */ - public StringDt getDescription() { - if (myDescription == null) { - myDescription = new StringDt(); - } - return myDescription; - } - - /** - * Sets the value(s) for description (Human-readable description (title)) - * - *

- * Definition: - * Human-readable description of the source document. This is sometimes known as the \"title\" - *

- */ - public DocumentManifest setDescription(StringDt theValue) { - myDescription = theValue; - return this; - } - - /** - * Sets the value for description (Human-readable description (title)) - * - *

- * Definition: - * Human-readable description of the source document. This is sometimes known as the \"title\" - *

- */ - public DocumentManifest setDescription( String theString) { - myDescription = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for confidentiality (Sensitivity of set of documents). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A code specifying the level of confidentiality of this set of Documents - *

- */ - public CodeableConceptDt getConfidentiality() { - if (myConfidentiality == null) { - myConfidentiality = new CodeableConceptDt(); - } - return myConfidentiality; - } - - /** - * Sets the value(s) for confidentiality (Sensitivity of set of documents) - * - *

- * Definition: - * A code specifying the level of confidentiality of this set of Documents - *

- */ - public DocumentManifest setConfidentiality(CodeableConceptDt theValue) { - myConfidentiality = theValue; - return this; - } - - - /** - * Gets the value(s) for content (Contents of this set of documents). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The list of resources that describe the parts of this document reference. Usually, these would be document references, but direct references to binary attachments and images are also allowed - *

- */ - public java.util.List getContent() { - if (myContent == null) { - myContent = new java.util.ArrayList(); - } - return myContent; - } - - /** - * Sets the value(s) for content (Contents of this set of documents) - * - *

- * Definition: - * The list of resources that describe the parts of this document reference. Usually, these would be document references, but direct references to binary attachments and images are also allowed - *

- */ - public DocumentManifest setContent(java.util.List theValue) { - myContent = theValue; - return this; - } - - /** - * Adds and returns a new value for content (Contents of this set of documents) - * - *

- * Definition: - * The list of resources that describe the parts of this document reference. Usually, these would be document references, but direct references to binary attachments and images are also allowed - *

- */ - public ResourceReferenceDt addContent() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getContent().add(newType); - return newType; - } - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DocumentReference.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DocumentReference.java deleted file mode 100644 index 1280ccb7c3a..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DocumentReference.java +++ /dev/null @@ -1,2482 +0,0 @@ - - - - - - - - - - - - - - - - -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.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.DocumentReferenceStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.DocumentRelationshipTypeEnum; -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.DateTimeDt; -import ca.uhn.fhir.model.primitive.InstantDt; -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.CompositeClientParam; -import ca.uhn.fhir.rest.gclient.DateClientParam; -import ca.uhn.fhir.rest.gclient.NumberClientParam; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.StringClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR DocumentReference Resource - * (A reference to a document) - * - *

- * Definition: - * A reference to a document - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/DocumentReference - *

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

- * Description:
- * Type: token
- * Path: DocumentReference.masterIdentifier | DocumentReference.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="DocumentReference.masterIdentifier | DocumentReference.identifier", description="", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - - /** - * Fluent Client search parameter constant for identifier - *

- * Description:
- * Type: token
- * Path: DocumentReference.masterIdentifier | DocumentReference.identifier
- *

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

- * Description:
- * Type: reference
- * Path: DocumentReference.subject
- *

- */ - @SearchParamDefinition(name="subject", path="DocumentReference.subject", description="", type="reference" ) - public static final String SP_SUBJECT = "subject"; - - /** - * Fluent Client search parameter constant for subject - *

- * Description:
- * Type: reference
- * Path: DocumentReference.subject
- *

- */ - public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DocumentReference.subject". - */ - public static final Include INCLUDE_SUBJECT = new Include("DocumentReference.subject"); - - /** - * Search parameter constant for type - *

- * Description:
- * Type: token
- * Path: DocumentReference.type
- *

- */ - @SearchParamDefinition(name="type", path="DocumentReference.type", description="", type="token" ) - public static final String SP_TYPE = "type"; - - /** - * Fluent Client search parameter constant for type - *

- * Description:
- * Type: token
- * Path: DocumentReference.type
- *

- */ - public static final TokenClientParam TYPE = new TokenClientParam(SP_TYPE); - - /** - * Search parameter constant for class - *

- * Description:
- * Type: token
- * Path: DocumentReference.class
- *

- */ - @SearchParamDefinition(name="class", path="DocumentReference.class", description="", type="token" ) - public static final String SP_CLASS = "class"; - - /** - * Fluent Client search parameter constant for class - *

- * Description:
- * Type: token
- * Path: DocumentReference.class
- *

- */ - public static final TokenClientParam CLASS = new TokenClientParam(SP_CLASS); - - /** - * Search parameter constant for author - *

- * Description:
- * Type: reference
- * Path: DocumentReference.author
- *

- */ - @SearchParamDefinition(name="author", path="DocumentReference.author", description="", type="reference" ) - public static final String SP_AUTHOR = "author"; - - /** - * Fluent Client search parameter constant for author - *

- * Description:
- * Type: reference
- * Path: DocumentReference.author
- *

- */ - public static final ReferenceClientParam AUTHOR = new ReferenceClientParam(SP_AUTHOR); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DocumentReference.author". - */ - public static final Include INCLUDE_AUTHOR = new Include("DocumentReference.author"); - - /** - * Search parameter constant for custodian - *

- * Description:
- * Type: reference
- * Path: DocumentReference.custodian
- *

- */ - @SearchParamDefinition(name="custodian", path="DocumentReference.custodian", description="", type="reference" ) - public static final String SP_CUSTODIAN = "custodian"; - - /** - * Fluent Client search parameter constant for custodian - *

- * Description:
- * Type: reference
- * Path: DocumentReference.custodian
- *

- */ - public static final ReferenceClientParam CUSTODIAN = new ReferenceClientParam(SP_CUSTODIAN); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DocumentReference.custodian". - */ - public static final Include INCLUDE_CUSTODIAN = new Include("DocumentReference.custodian"); - - /** - * Search parameter constant for authenticator - *

- * Description:
- * Type: reference
- * Path: DocumentReference.authenticator
- *

- */ - @SearchParamDefinition(name="authenticator", path="DocumentReference.authenticator", description="", type="reference" ) - public static final String SP_AUTHENTICATOR = "authenticator"; - - /** - * Fluent Client search parameter constant for authenticator - *

- * Description:
- * Type: reference
- * Path: DocumentReference.authenticator
- *

- */ - public static final ReferenceClientParam AUTHENTICATOR = new ReferenceClientParam(SP_AUTHENTICATOR); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DocumentReference.authenticator". - */ - public static final Include INCLUDE_AUTHENTICATOR = new Include("DocumentReference.authenticator"); - - /** - * Search parameter constant for created - *

- * Description:
- * Type: date
- * Path: DocumentReference.created
- *

- */ - @SearchParamDefinition(name="created", path="DocumentReference.created", description="", type="date" ) - public static final String SP_CREATED = "created"; - - /** - * Fluent Client search parameter constant for created - *

- * Description:
- * Type: date
- * Path: DocumentReference.created
- *

- */ - public static final DateClientParam CREATED = new DateClientParam(SP_CREATED); - - /** - * Search parameter constant for indexed - *

- * Description:
- * Type: date
- * Path: DocumentReference.indexed
- *

- */ - @SearchParamDefinition(name="indexed", path="DocumentReference.indexed", description="", type="date" ) - public static final String SP_INDEXED = "indexed"; - - /** - * Fluent Client search parameter constant for indexed - *

- * Description:
- * Type: date
- * Path: DocumentReference.indexed
- *

- */ - public static final DateClientParam INDEXED = new DateClientParam(SP_INDEXED); - - /** - * Search parameter constant for status - *

- * Description:
- * Type: token
- * Path: DocumentReference.status
- *

- */ - @SearchParamDefinition(name="status", path="DocumentReference.status", description="", type="token" ) - public static final String SP_STATUS = "status"; - - /** - * Fluent Client search parameter constant for status - *

- * Description:
- * Type: token
- * Path: DocumentReference.status
- *

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

- * Description:
- * Type: reference
- * Path: DocumentReference.relatesTo.target
- *

- */ - @SearchParamDefinition(name="relatesto", path="DocumentReference.relatesTo.target", description="", type="reference" ) - public static final String SP_RELATESTO = "relatesto"; - - /** - * Fluent Client search parameter constant for relatesto - *

- * Description:
- * Type: reference
- * Path: DocumentReference.relatesTo.target
- *

- */ - public static final ReferenceClientParam RELATESTO = new ReferenceClientParam(SP_RELATESTO); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DocumentReference.relatesTo.target". - */ - public static final Include INCLUDE_RELATESTO_TARGET = new Include("DocumentReference.relatesTo.target"); - - /** - * Search parameter constant for relation - *

- * Description:
- * Type: token
- * Path: DocumentReference.relatesTo.code
- *

- */ - @SearchParamDefinition(name="relation", path="DocumentReference.relatesTo.code", description="", type="token" ) - public static final String SP_RELATION = "relation"; - - /** - * Fluent Client search parameter constant for relation - *

- * Description:
- * Type: token
- * Path: DocumentReference.relatesTo.code
- *

- */ - public static final TokenClientParam RELATION = new TokenClientParam(SP_RELATION); - - /** - * Search parameter constant for description - *

- * Description:
- * Type: string
- * Path: DocumentReference.description
- *

- */ - @SearchParamDefinition(name="description", path="DocumentReference.description", description="", type="string" ) - public static final String SP_DESCRIPTION = "description"; - - /** - * Fluent Client search parameter constant for description - *

- * Description:
- * Type: string
- * Path: DocumentReference.description
- *

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

- * Description:
- * Type: token
- * Path: DocumentReference.confidentiality
- *

- */ - @SearchParamDefinition(name="confidentiality", path="DocumentReference.confidentiality", description="", type="token" ) - public static final String SP_CONFIDENTIALITY = "confidentiality"; - - /** - * Fluent Client search parameter constant for confidentiality - *

- * Description:
- * Type: token
- * Path: DocumentReference.confidentiality
- *

- */ - public static final TokenClientParam CONFIDENTIALITY = new TokenClientParam(SP_CONFIDENTIALITY); - - /** - * Search parameter constant for language - *

- * Description:
- * Type: token
- * Path: DocumentReference.primaryLanguage
- *

- */ - @SearchParamDefinition(name="language", path="DocumentReference.primaryLanguage", description="", type="token" ) - public static final String SP_LANGUAGE = "language"; - - /** - * Fluent Client search parameter constant for language - *

- * Description:
- * Type: token
- * Path: DocumentReference.primaryLanguage
- *

- */ - public static final TokenClientParam LANGUAGE = new TokenClientParam(SP_LANGUAGE); - - /** - * Search parameter constant for format - *

- * Description:
- * Type: token
- * Path: DocumentReference.format
- *

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

- * Description:
- * Type: token
- * Path: DocumentReference.format
- *

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

- * Description:
- * Type: number
- * Path: DocumentReference.size
- *

- */ - @SearchParamDefinition(name="size", path="DocumentReference.size", description="", type="number" ) - public static final String SP_SIZE = "size"; - - /** - * Fluent Client search parameter constant for size - *

- * Description:
- * Type: number
- * Path: DocumentReference.size
- *

- */ - public static final NumberClientParam SIZE = new NumberClientParam(SP_SIZE); - - /** - * Search parameter constant for location - *

- * Description:
- * Type: string
- * Path: DocumentReference.location
- *

- */ - @SearchParamDefinition(name="location", path="DocumentReference.location", description="", type="string" ) - public static final String SP_LOCATION = "location"; - - /** - * Fluent Client search parameter constant for location - *

- * Description:
- * Type: string
- * Path: DocumentReference.location
- *

- */ - public static final StringClientParam LOCATION = new StringClientParam(SP_LOCATION); - - /** - * Search parameter constant for event - *

- * Description:
- * Type: token
- * Path: DocumentReference.context.event
- *

- */ - @SearchParamDefinition(name="event", path="DocumentReference.context.event", description="", type="token" ) - public static final String SP_EVENT = "event"; - - /** - * Fluent Client search parameter constant for event - *

- * Description:
- * Type: token
- * Path: DocumentReference.context.event
- *

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

- * Description:
- * Type: date
- * Path: DocumentReference.context.period
- *

- */ - @SearchParamDefinition(name="period", path="DocumentReference.context.period", description="", type="date" ) - public static final String SP_PERIOD = "period"; - - /** - * Fluent Client search parameter constant for period - *

- * Description:
- * Type: date
- * Path: DocumentReference.context.period
- *

- */ - public static final DateClientParam PERIOD = new DateClientParam(SP_PERIOD); - - /** - * Search parameter constant for facility - *

- * Description:
- * Type: token
- * Path: DocumentReference.context.facilityType
- *

- */ - @SearchParamDefinition(name="facility", path="DocumentReference.context.facilityType", description="", type="token" ) - public static final String SP_FACILITY = "facility"; - - /** - * Fluent Client search parameter constant for facility - *

- * Description:
- * Type: token
- * Path: DocumentReference.context.facilityType
- *

- */ - public static final TokenClientParam FACILITY = new TokenClientParam(SP_FACILITY); - - /** - * Search parameter constant for relatesto-relation - *

- * Description: Combination of relation and relatesTo
- * Type: composite
- * Path: relatesto & relation
- *

- */ - @SearchParamDefinition(name="relatesto-relation", path="relatesto & relation", description="Combination of relation and relatesTo", type="composite" , compositeOf={ "relatesto", "relation" } ) - public static final String SP_RELATESTO_RELATION = "relatesto-relation"; - - /** - * Fluent Client search parameter constant for relatesto-relation - *

- * Description: Combination of relation and relatesTo
- * Type: composite
- * Path: relatesto & relation
- *

- */ - public static final CompositeClientParam RELATESTO_RELATION = new CompositeClientParam(SP_RELATESTO_RELATION); - - - @Child(name="masterIdentifier", type=IdentifierDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Master Version Specific Identifier", - formalDefinition="Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document" - ) - private IdentifierDt myMasterIdentifier; - - @Child(name="identifier", type=IdentifierDt.class, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Other identifiers for the document", - formalDefinition="Other identifiers associated with the document, including version independent, source record and workflow related identifiers" - ) - private java.util.List myIdentifier; - - @Child(name="subject", order=2, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Group.class, ca.uhn.fhir.model.dstu.resource.Device.class }) - @Description( - shortDefinition="Who|what is the subject of the document", - formalDefinition="Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure)" - ) - private ResourceReferenceDt mySubject; - - @Child(name="type", type=CodeableConceptDt.class, order=3, min=1, max=1) - @Description( - shortDefinition="What kind of document this is (LOINC if possible)", - formalDefinition="Specifies the particular kind of document (e.g. Patient Summary, Discharge Summary, Prescription, etc.)" - ) - private CodeableConceptDt myType; - - @Child(name="class", type=CodeableConceptDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="Categorization of Document", - formalDefinition="A categorization for the type of the document. This may be implied by or derived from the code specified in the Document Type" - ) - private CodeableConceptDt myClassElement; - - @Child(name="author", order=5, min=1, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Device.class, ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.RelatedPerson.class }) - @Description( - shortDefinition="Who and/or what authored the document", - formalDefinition="Identifies who is responsible for adding the information to the document" - ) - private java.util.List myAuthor; - - @Child(name="custodian", order=6, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Organization.class }) - @Description( - shortDefinition="Org which maintains the document", - formalDefinition="Identifies the organization or group who is responsible for ongoing maintenance of and access to the document" - ) - private ResourceReferenceDt myCustodian; - - @Child(name="policyManager", type=UriDt.class, order=7, min=0, max=1) - @Description( - shortDefinition="Manages access policies for the document", - formalDefinition="A reference to a domain or server that manages policies under which the document is accessed and/or made available" - ) - private UriDt myPolicyManager; - - @Child(name="authenticator", order=8, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Organization.class }) - @Description( - shortDefinition="Who/What authenticated the document", - formalDefinition="Which person or organization authenticates that this document is valid" - ) - private ResourceReferenceDt myAuthenticator; - - @Child(name="created", type=DateTimeDt.class, order=9, min=0, max=1) - @Description( - shortDefinition="Document creation time", - formalDefinition="When the document was created" - ) - private DateTimeDt myCreated; - - @Child(name="indexed", type=InstantDt.class, order=10, min=1, max=1) - @Description( - shortDefinition="When this document reference created", - formalDefinition="When the document reference was created" - ) - private InstantDt myIndexed; - - @Child(name="status", type=CodeDt.class, order=11, min=1, max=1) - @Description( - shortDefinition="current | superceded | entered in error", - formalDefinition="The status of this document reference" - ) - private BoundCodeDt myStatus; - - @Child(name="docStatus", type=CodeableConceptDt.class, order=12, min=0, max=1) - @Description( - shortDefinition="preliminary | final | appended | amended | entered in error", - formalDefinition="The status of the underlying document" - ) - private CodeableConceptDt myDocStatus; - - @Child(name="relatesTo", order=13, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Relationships to other documents", - formalDefinition="Relationships that this document has with other document references that already exist" - ) - private java.util.List myRelatesTo; - - @Child(name="description", type=StringDt.class, order=14, min=0, max=1) - @Description( - shortDefinition="Human-readable description (title)", - formalDefinition="Human-readable description of the source document. This is sometimes known as the \"title\"" - ) - private StringDt myDescription; - - @Child(name="confidentiality", type=CodeableConceptDt.class, order=15, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Sensitivity of source document", - formalDefinition="A code specifying the level of confidentiality of the XDS Document" - ) - private java.util.List myConfidentiality; - - @Child(name="primaryLanguage", type=CodeDt.class, order=16, min=0, max=1) - @Description( - shortDefinition="The marked primary language for the document", - formalDefinition="The primary language in which the source document is written" - ) - private CodeDt myPrimaryLanguage; - - @Child(name="mimeType", type=CodeDt.class, order=17, min=1, max=1) - @Description( - shortDefinition="Mime type, + maybe character encoding", - formalDefinition="The mime type of the source document" - ) - private CodeDt myMimeType; - - @Child(name="format", type=UriDt.class, order=18, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Format/content rules for the document", - formalDefinition="An identifier that identifies that the format and content of the document conforms to additional rules beyond the base format indicated in the mimeType" - ) - private java.util.List myFormat; - - @Child(name="size", type=IntegerDt.class, order=19, min=0, max=1) - @Description( - shortDefinition="Size of the document in bytes", - formalDefinition="The size of the source document this reference refers to in bytes" - ) - private IntegerDt mySize; - - @Child(name="hash", type=StringDt.class, order=20, min=0, max=1) - @Description( - shortDefinition="HexBinary representation of SHA1", - formalDefinition="A hash of the source document to ensure that changes have not occurred" - ) - private StringDt myHash; - - @Child(name="location", type=UriDt.class, order=21, min=0, max=1) - @Description( - shortDefinition="Where to access the document", - formalDefinition="A url at which the document can be accessed" - ) - private UriDt myLocation; - - @Child(name="service", order=22, min=0, max=1) - @Description( - shortDefinition="If access is not fully described by location", - formalDefinition="A description of a service call that can be used to retrieve the document" - ) - private Service myService; - - @Child(name="context", order=23, min=0, max=1) - @Description( - shortDefinition="Clinical context of document", - formalDefinition="The clinical context in which the document was prepared" - ) - private Context myContext; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myMasterIdentifier, myIdentifier, mySubject, myType, myClassElement, myAuthor, myCustodian, myPolicyManager, myAuthenticator, myCreated, myIndexed, myStatus, myDocStatus, myRelatesTo, myDescription, myConfidentiality, myPrimaryLanguage, myMimeType, myFormat, mySize, myHash, myLocation, myService, myContext); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myMasterIdentifier, myIdentifier, mySubject, myType, myClassElement, myAuthor, myCustodian, myPolicyManager, myAuthenticator, myCreated, myIndexed, myStatus, myDocStatus, myRelatesTo, myDescription, myConfidentiality, myPrimaryLanguage, myMimeType, myFormat, mySize, myHash, myLocation, myService, myContext); - } - - /** - * Gets the value(s) for masterIdentifier (Master Version Specific Identifier). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document - *

- */ - public IdentifierDt getMasterIdentifier() { - if (myMasterIdentifier == null) { - myMasterIdentifier = new IdentifierDt(); - } - return myMasterIdentifier; - } - - /** - * Sets the value(s) for masterIdentifier (Master Version Specific Identifier) - * - *

- * Definition: - * Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document - *

- */ - public DocumentReference setMasterIdentifier(IdentifierDt theValue) { - myMasterIdentifier = theValue; - return this; - } - - /** - * Sets the value for masterIdentifier (Master Version Specific Identifier) - * - *

- * Definition: - * Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document - *

- */ - public DocumentReference setMasterIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - myMasterIdentifier = new IdentifierDt(theUse, theSystem, theValue, theLabel); - return this; - } - - /** - * Sets the value for masterIdentifier (Master Version Specific Identifier) - * - *

- * Definition: - * Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document - *

- */ - public DocumentReference setMasterIdentifier( String theSystem, String theValue) { - myMasterIdentifier = new IdentifierDt(theSystem, theValue); - return this; - } - - - /** - * Gets the value(s) for identifier (Other identifiers for the document). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Other identifiers associated with the document, including version independent, source record and workflow related identifiers - *

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Other identifiers for the document) - * - *

- * Definition: - * Other identifiers associated with the document, including version independent, source record and workflow related identifiers - *

- */ - public DocumentReference setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (Other identifiers for the document) - * - *

- * Definition: - * Other identifiers associated with the document, including version independent, source record and workflow related identifiers - *

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (Other identifiers for the document), - * creating it if it does not already exist. - * - *

- * Definition: - * Other identifiers associated with the document, including version independent, source record and workflow related identifiers - *

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (Other identifiers for the document) - * - *

- * Definition: - * Other identifiers associated with the document, including version independent, source record and workflow related identifiers - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public DocumentReference addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (Other identifiers for the document) - * - *

- * Definition: - * Other identifiers associated with the document, including version independent, source record and workflow related identifiers - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public DocumentReference addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for subject (Who|what is the subject of the document). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure) - *

- */ - public ResourceReferenceDt getSubject() { - if (mySubject == null) { - mySubject = new ResourceReferenceDt(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (Who|what is the subject of the document) - * - *

- * Definition: - * Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure) - *

- */ - public DocumentReference setSubject(ResourceReferenceDt theValue) { - mySubject = theValue; - return this; - } - - - /** - * Gets the value(s) for type (What kind of document this is (LOINC if possible)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Specifies the particular kind of document (e.g. Patient Summary, Discharge Summary, Prescription, etc.) - *

- */ - public CodeableConceptDt getType() { - if (myType == null) { - myType = new CodeableConceptDt(); - } - return myType; - } - - /** - * Sets the value(s) for type (What kind of document this is (LOINC if possible)) - * - *

- * Definition: - * Specifies the particular kind of document (e.g. Patient Summary, Discharge Summary, Prescription, etc.) - *

- */ - public DocumentReference setType(CodeableConceptDt theValue) { - myType = theValue; - return this; - } - - - /** - * Gets the value(s) for class (Categorization of Document). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A categorization for the type of the document. This may be implied by or derived from the code specified in the Document Type - *

- */ - public CodeableConceptDt getClassElement() { - if (myClassElement == null) { - myClassElement = new CodeableConceptDt(); - } - return myClassElement; - } - - /** - * Sets the value(s) for class (Categorization of Document) - * - *

- * Definition: - * A categorization for the type of the document. This may be implied by or derived from the code specified in the Document Type - *

- */ - public DocumentReference setClassElement(CodeableConceptDt theValue) { - myClassElement = theValue; - return this; - } - - - /** - * Gets the value(s) for author (Who and/or what authored the document). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies who is responsible for adding the information to the document - *

- */ - public java.util.List getAuthor() { - if (myAuthor == null) { - myAuthor = new java.util.ArrayList(); - } - return myAuthor; - } - - /** - * Sets the value(s) for author (Who and/or what authored the document) - * - *

- * Definition: - * Identifies who is responsible for adding the information to the document - *

- */ - public DocumentReference setAuthor(java.util.List theValue) { - myAuthor = theValue; - return this; - } - - /** - * Adds and returns a new value for author (Who and/or what authored the document) - * - *

- * Definition: - * Identifies who is responsible for adding the information to the document - *

- */ - public ResourceReferenceDt addAuthor() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getAuthor().add(newType); - return newType; - } - - /** - * Gets the value(s) for custodian (Org which maintains the document). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the organization or group who is responsible for ongoing maintenance of and access to the document - *

- */ - public ResourceReferenceDt getCustodian() { - if (myCustodian == null) { - myCustodian = new ResourceReferenceDt(); - } - return myCustodian; - } - - /** - * Sets the value(s) for custodian (Org which maintains the document) - * - *

- * Definition: - * Identifies the organization or group who is responsible for ongoing maintenance of and access to the document - *

- */ - public DocumentReference setCustodian(ResourceReferenceDt theValue) { - myCustodian = theValue; - return this; - } - - - /** - * Gets the value(s) for policyManager (Manages access policies for the document). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A reference to a domain or server that manages policies under which the document is accessed and/or made available - *

- */ - public UriDt getPolicyManager() { - if (myPolicyManager == null) { - myPolicyManager = new UriDt(); - } - return myPolicyManager; - } - - /** - * Sets the value(s) for policyManager (Manages access policies for the document) - * - *

- * Definition: - * A reference to a domain or server that manages policies under which the document is accessed and/or made available - *

- */ - public DocumentReference setPolicyManager(UriDt theValue) { - myPolicyManager = theValue; - return this; - } - - /** - * Sets the value for policyManager (Manages access policies for the document) - * - *

- * Definition: - * A reference to a domain or server that manages policies under which the document is accessed and/or made available - *

- */ - public DocumentReference setPolicyManager( String theUri) { - myPolicyManager = new UriDt(theUri); - return this; - } - - - /** - * Gets the value(s) for authenticator (Who/What authenticated the document). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Which person or organization authenticates that this document is valid - *

- */ - public ResourceReferenceDt getAuthenticator() { - if (myAuthenticator == null) { - myAuthenticator = new ResourceReferenceDt(); - } - return myAuthenticator; - } - - /** - * Sets the value(s) for authenticator (Who/What authenticated the document) - * - *

- * Definition: - * Which person or organization authenticates that this document is valid - *

- */ - public DocumentReference setAuthenticator(ResourceReferenceDt theValue) { - myAuthenticator = theValue; - return this; - } - - - /** - * Gets the value(s) for created (Document creation time). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * When the document was created - *

- */ - public DateTimeDt getCreated() { - if (myCreated == null) { - myCreated = new DateTimeDt(); - } - return myCreated; - } - - /** - * Sets the value(s) for created (Document creation time) - * - *

- * Definition: - * When the document was created - *

- */ - public DocumentReference setCreated(DateTimeDt theValue) { - myCreated = theValue; - return this; - } - - /** - * Sets the value for created (Document creation time) - * - *

- * Definition: - * When the document was created - *

- */ - public DocumentReference setCreatedWithSecondsPrecision( Date theDate) { - myCreated = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for created (Document creation time) - * - *

- * Definition: - * When the document was created - *

- */ - public DocumentReference setCreated( Date theDate, TemporalPrecisionEnum thePrecision) { - myCreated = new DateTimeDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for indexed (When this document reference created). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * When the document reference was created - *

- */ - public InstantDt getIndexed() { - if (myIndexed == null) { - myIndexed = new InstantDt(); - } - return myIndexed; - } - - /** - * Sets the value(s) for indexed (When this document reference created) - * - *

- * Definition: - * When the document reference was created - *

- */ - public DocumentReference setIndexed(InstantDt theValue) { - myIndexed = theValue; - return this; - } - - /** - * Sets the value for indexed (When this document reference created) - * - *

- * Definition: - * When the document reference was created - *

- */ - public DocumentReference setIndexed( Date theDate, TemporalPrecisionEnum thePrecision) { - myIndexed = new InstantDt(theDate, thePrecision); - return this; - } - - /** - * Sets the value for indexed (When this document reference created) - * - *

- * Definition: - * When the document reference was created - *

- */ - public DocumentReference setIndexedWithMillisPrecision( Date theDate) { - myIndexed = new InstantDt(theDate); - return this; - } - - - /** - * Gets the value(s) for status (current | superceded | entered in error). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The status of this document reference - *

- */ - public BoundCodeDt getStatus() { - if (myStatus == null) { - myStatus = new BoundCodeDt(DocumentReferenceStatusEnum.VALUESET_BINDER); - } - return myStatus; - } - - /** - * Sets the value(s) for status (current | superceded | entered in error) - * - *

- * Definition: - * The status of this document reference - *

- */ - public DocumentReference setStatus(BoundCodeDt theValue) { - myStatus = theValue; - return this; - } - - /** - * Sets the value(s) for status (current | superceded | entered in error) - * - *

- * Definition: - * The status of this document reference - *

- */ - public DocumentReference setStatus(DocumentReferenceStatusEnum theValue) { - getStatus().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for docStatus (preliminary | final | appended | amended | entered in error). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The status of the underlying document - *

- */ - public CodeableConceptDt getDocStatus() { - if (myDocStatus == null) { - myDocStatus = new CodeableConceptDt(); - } - return myDocStatus; - } - - /** - * Sets the value(s) for docStatus (preliminary | final | appended | amended | entered in error) - * - *

- * Definition: - * The status of the underlying document - *

- */ - public DocumentReference setDocStatus(CodeableConceptDt theValue) { - myDocStatus = theValue; - return this; - } - - - /** - * Gets the value(s) for relatesTo (Relationships to other documents). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Relationships that this document has with other document references that already exist - *

- */ - public java.util.List getRelatesTo() { - if (myRelatesTo == null) { - myRelatesTo = new java.util.ArrayList(); - } - return myRelatesTo; - } - - /** - * Sets the value(s) for relatesTo (Relationships to other documents) - * - *

- * Definition: - * Relationships that this document has with other document references that already exist - *

- */ - public DocumentReference setRelatesTo(java.util.List theValue) { - myRelatesTo = theValue; - return this; - } - - /** - * Adds and returns a new value for relatesTo (Relationships to other documents) - * - *

- * Definition: - * Relationships that this document has with other document references that already exist - *

- */ - public RelatesTo addRelatesTo() { - RelatesTo newType = new RelatesTo(); - getRelatesTo().add(newType); - return newType; - } - - /** - * Gets the first repetition for relatesTo (Relationships to other documents), - * creating it if it does not already exist. - * - *

- * Definition: - * Relationships that this document has with other document references that already exist - *

- */ - public RelatesTo getRelatesToFirstRep() { - if (getRelatesTo().isEmpty()) { - return addRelatesTo(); - } - return getRelatesTo().get(0); - } - - /** - * Gets the value(s) for description (Human-readable description (title)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Human-readable description of the source document. This is sometimes known as the \"title\" - *

- */ - public StringDt getDescription() { - if (myDescription == null) { - myDescription = new StringDt(); - } - return myDescription; - } - - /** - * Sets the value(s) for description (Human-readable description (title)) - * - *

- * Definition: - * Human-readable description of the source document. This is sometimes known as the \"title\" - *

- */ - public DocumentReference setDescription(StringDt theValue) { - myDescription = theValue; - return this; - } - - /** - * Sets the value for description (Human-readable description (title)) - * - *

- * Definition: - * Human-readable description of the source document. This is sometimes known as the \"title\" - *

- */ - public DocumentReference setDescription( String theString) { - myDescription = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for confidentiality (Sensitivity of source document). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A code specifying the level of confidentiality of the XDS Document - *

- */ - public java.util.List getConfidentiality() { - if (myConfidentiality == null) { - myConfidentiality = new java.util.ArrayList(); - } - return myConfidentiality; - } - - /** - * Sets the value(s) for confidentiality (Sensitivity of source document) - * - *

- * Definition: - * A code specifying the level of confidentiality of the XDS Document - *

- */ - public DocumentReference setConfidentiality(java.util.List theValue) { - myConfidentiality = theValue; - return this; - } - - /** - * Adds and returns a new value for confidentiality (Sensitivity of source document) - * - *

- * Definition: - * A code specifying the level of confidentiality of the XDS Document - *

- */ - public CodeableConceptDt addConfidentiality() { - CodeableConceptDt newType = new CodeableConceptDt(); - getConfidentiality().add(newType); - return newType; - } - - /** - * Gets the first repetition for confidentiality (Sensitivity of source document), - * creating it if it does not already exist. - * - *

- * Definition: - * A code specifying the level of confidentiality of the XDS Document - *

- */ - public CodeableConceptDt getConfidentialityFirstRep() { - if (getConfidentiality().isEmpty()) { - return addConfidentiality(); - } - return getConfidentiality().get(0); - } - - /** - * Gets the value(s) for primaryLanguage (The marked primary language for the document). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The primary language in which the source document is written - *

- */ - public CodeDt getPrimaryLanguage() { - if (myPrimaryLanguage == null) { - myPrimaryLanguage = new CodeDt(); - } - return myPrimaryLanguage; - } - - /** - * Sets the value(s) for primaryLanguage (The marked primary language for the document) - * - *

- * Definition: - * The primary language in which the source document is written - *

- */ - public DocumentReference setPrimaryLanguage(CodeDt theValue) { - myPrimaryLanguage = theValue; - return this; - } - - /** - * Sets the value for primaryLanguage (The marked primary language for the document) - * - *

- * Definition: - * The primary language in which the source document is written - *

- */ - public DocumentReference setPrimaryLanguage( String theCode) { - myPrimaryLanguage = new CodeDt(theCode); - return this; - } - - - /** - * Gets the value(s) for mimeType (Mime type, + maybe character encoding). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The mime type of the source document - *

- */ - public CodeDt getMimeType() { - if (myMimeType == null) { - myMimeType = new CodeDt(); - } - return myMimeType; - } - - /** - * Sets the value(s) for mimeType (Mime type, + maybe character encoding) - * - *

- * Definition: - * The mime type of the source document - *

- */ - public DocumentReference setMimeType(CodeDt theValue) { - myMimeType = theValue; - return this; - } - - /** - * Sets the value for mimeType (Mime type, + maybe character encoding) - * - *

- * Definition: - * The mime type of the source document - *

- */ - public DocumentReference setMimeType( String theCode) { - myMimeType = new CodeDt(theCode); - return this; - } - - - /** - * Gets the value(s) for format (Format/content rules for the document). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * An identifier that identifies that the format and content of the document conforms to additional rules beyond the base format indicated in the mimeType - *

- */ - public java.util.List getFormat() { - if (myFormat == null) { - myFormat = new java.util.ArrayList(); - } - return myFormat; - } - - /** - * Sets the value(s) for format (Format/content rules for the document) - * - *

- * Definition: - * An identifier that identifies that the format and content of the document conforms to additional rules beyond the base format indicated in the mimeType - *

- */ - public DocumentReference setFormat(java.util.List theValue) { - myFormat = theValue; - return this; - } - - /** - * Adds and returns a new value for format (Format/content rules for the document) - * - *

- * Definition: - * An identifier that identifies that the format and content of the document conforms to additional rules beyond the base format indicated in the mimeType - *

- */ - public UriDt addFormat() { - UriDt newType = new UriDt(); - getFormat().add(newType); - return newType; - } - - /** - * Gets the first repetition for format (Format/content rules for the document), - * creating it if it does not already exist. - * - *

- * Definition: - * An identifier that identifies that the format and content of the document conforms to additional rules beyond the base format indicated in the mimeType - *

- */ - public UriDt getFormatFirstRep() { - if (getFormat().isEmpty()) { - return addFormat(); - } - return getFormat().get(0); - } - /** - * Adds a new value for format (Format/content rules for the document) - * - *

- * Definition: - * An identifier that identifies that the format and content of the document conforms to additional rules beyond the base format indicated in the mimeType - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public DocumentReference addFormat( String theUri) { - if (myFormat == null) { - myFormat = new java.util.ArrayList(); - } - myFormat.add(new UriDt(theUri)); - return this; - } - - - /** - * Gets the value(s) for size (Size of the document in bytes). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The size of the source document this reference refers to in bytes - *

- */ - public IntegerDt getSize() { - if (mySize == null) { - mySize = new IntegerDt(); - } - return mySize; - } - - /** - * Sets the value(s) for size (Size of the document in bytes) - * - *

- * Definition: - * The size of the source document this reference refers to in bytes - *

- */ - public DocumentReference setSize(IntegerDt theValue) { - mySize = theValue; - return this; - } - - /** - * Sets the value for size (Size of the document in bytes) - * - *

- * Definition: - * The size of the source document this reference refers to in bytes - *

- */ - public DocumentReference setSize( int theInteger) { - mySize = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for hash (HexBinary representation of SHA1). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A hash of the source document to ensure that changes have not occurred - *

- */ - public StringDt getHash() { - if (myHash == null) { - myHash = new StringDt(); - } - return myHash; - } - - /** - * Sets the value(s) for hash (HexBinary representation of SHA1) - * - *

- * Definition: - * A hash of the source document to ensure that changes have not occurred - *

- */ - public DocumentReference setHash(StringDt theValue) { - myHash = theValue; - return this; - } - - /** - * Sets the value for hash (HexBinary representation of SHA1) - * - *

- * Definition: - * A hash of the source document to ensure that changes have not occurred - *

- */ - public DocumentReference setHash( String theString) { - myHash = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for location (Where to access the document). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A url at which the document can be accessed - *

- */ - public UriDt getLocation() { - if (myLocation == null) { - myLocation = new UriDt(); - } - return myLocation; - } - - /** - * Sets the value(s) for location (Where to access the document) - * - *

- * Definition: - * A url at which the document can be accessed - *

- */ - public DocumentReference setLocation(UriDt theValue) { - myLocation = theValue; - return this; - } - - /** - * Sets the value for location (Where to access the document) - * - *

- * Definition: - * A url at which the document can be accessed - *

- */ - public DocumentReference setLocation( String theUri) { - myLocation = new UriDt(theUri); - return this; - } - - - /** - * Gets the value(s) for service (If access is not fully described by location). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A description of a service call that can be used to retrieve the document - *

- */ - public Service getService() { - if (myService == null) { - myService = new Service(); - } - return myService; - } - - /** - * Sets the value(s) for service (If access is not fully described by location) - * - *

- * Definition: - * A description of a service call that can be used to retrieve the document - *

- */ - public DocumentReference setService(Service theValue) { - myService = theValue; - return this; - } - - - /** - * Gets the value(s) for context (Clinical context of document). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The clinical context in which the document was prepared - *

- */ - public Context getContext() { - if (myContext == null) { - myContext = new Context(); - } - return myContext; - } - - /** - * Sets the value(s) for context (Clinical context of document) - * - *

- * Definition: - * The clinical context in which the document was prepared - *

- */ - public DocumentReference setContext(Context theValue) { - myContext = theValue; - return this; - } - - - /** - * Block class for child element: DocumentReference.relatesTo (Relationships to other documents) - * - *

- * Definition: - * Relationships that this document has with other document references that already exist - *

- */ - @Block() - public static class RelatesTo extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="code", type=CodeDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="replaces | transforms | signs | appends", - formalDefinition="The type of relationship that this document has with anther document" - ) - private BoundCodeDt myCode; - - @Child(name="target", order=1, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.DocumentReference.class }) - @Description( - shortDefinition="Target of the relationship", - formalDefinition="The target document of this relationship" - ) - private ResourceReferenceDt myTarget; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCode, myTarget); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCode, myTarget); - } - - /** - * Gets the value(s) for code (replaces | transforms | signs | appends). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The type of relationship that this document has with anther document - *

- */ - public BoundCodeDt getCode() { - if (myCode == null) { - myCode = new BoundCodeDt(DocumentRelationshipTypeEnum.VALUESET_BINDER); - } - return myCode; - } - - /** - * Sets the value(s) for code (replaces | transforms | signs | appends) - * - *

- * Definition: - * The type of relationship that this document has with anther document - *

- */ - public RelatesTo setCode(BoundCodeDt theValue) { - myCode = theValue; - return this; - } - - /** - * Sets the value(s) for code (replaces | transforms | signs | appends) - * - *

- * Definition: - * The type of relationship that this document has with anther document - *

- */ - public RelatesTo setCode(DocumentRelationshipTypeEnum theValue) { - getCode().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for target (Target of the relationship). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The target document of this relationship - *

- */ - public ResourceReferenceDt getTarget() { - if (myTarget == null) { - myTarget = new ResourceReferenceDt(); - } - return myTarget; - } - - /** - * Sets the value(s) for target (Target of the relationship) - * - *

- * Definition: - * The target document of this relationship - *

- */ - public RelatesTo setTarget(ResourceReferenceDt theValue) { - myTarget = theValue; - return this; - } - - - - } - - - /** - * Block class for child element: DocumentReference.service (If access is not fully described by location) - * - *

- * Definition: - * A description of a service call that can be used to retrieve the document - *

- */ - @Block() - public static class Service extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="type", type=CodeableConceptDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Type of service (i.e. XDS.b)", - formalDefinition="The type of the service that can be used to access the documents" - ) - private CodeableConceptDt myType; - - @Child(name="address", type=StringDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Where service is located (usually a URL)", - formalDefinition="Where the service end-point is located" - ) - private StringDt myAddress; - - @Child(name="parameter", order=2, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Service call parameters", - formalDefinition="A list of named parameters that is used in the service call" - ) - private java.util.List myParameter; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myType, myAddress, myParameter); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myType, myAddress, myParameter); - } - - /** - * Gets the value(s) for type (Type of service (i.e. XDS.b)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The type of the service that can be used to access the documents - *

- */ - public CodeableConceptDt getType() { - if (myType == null) { - myType = new CodeableConceptDt(); - } - return myType; - } - - /** - * Sets the value(s) for type (Type of service (i.e. XDS.b)) - * - *

- * Definition: - * The type of the service that can be used to access the documents - *

- */ - public Service setType(CodeableConceptDt theValue) { - myType = theValue; - return this; - } - - - /** - * Gets the value(s) for address (Where service is located (usually a URL)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Where the service end-point is located - *

- */ - public StringDt getAddress() { - if (myAddress == null) { - myAddress = new StringDt(); - } - return myAddress; - } - - /** - * Sets the value(s) for address (Where service is located (usually a URL)) - * - *

- * Definition: - * Where the service end-point is located - *

- */ - public Service setAddress(StringDt theValue) { - myAddress = theValue; - return this; - } - - /** - * Sets the value for address (Where service is located (usually a URL)) - * - *

- * Definition: - * Where the service end-point is located - *

- */ - public Service setAddress( String theString) { - myAddress = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for parameter (Service call parameters). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A list of named parameters that is used in the service call - *

- */ - public java.util.List getParameter() { - if (myParameter == null) { - myParameter = new java.util.ArrayList(); - } - return myParameter; - } - - /** - * Sets the value(s) for parameter (Service call parameters) - * - *

- * Definition: - * A list of named parameters that is used in the service call - *

- */ - public Service setParameter(java.util.List theValue) { - myParameter = theValue; - return this; - } - - /** - * Adds and returns a new value for parameter (Service call parameters) - * - *

- * Definition: - * A list of named parameters that is used in the service call - *

- */ - public ServiceParameter addParameter() { - ServiceParameter newType = new ServiceParameter(); - getParameter().add(newType); - return newType; - } - - /** - * Gets the first repetition for parameter (Service call parameters), - * creating it if it does not already exist. - * - *

- * Definition: - * A list of named parameters that is used in the service call - *

- */ - public ServiceParameter getParameterFirstRep() { - if (getParameter().isEmpty()) { - return addParameter(); - } - return getParameter().get(0); - } - - - } - - /** - * Block class for child element: DocumentReference.service.parameter (Service call parameters) - * - *

- * Definition: - * A list of named parameters that is used in the service call - *

- */ - @Block() - public static class ServiceParameter extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="name", type=StringDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Parameter name in service call", - formalDefinition="The name of a parameter" - ) - private StringDt myName; - - @Child(name="value", type=StringDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Parameter value for the name", - formalDefinition="The value of the named parameter" - ) - private StringDt myValue; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myName, myValue); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myName, myValue); - } - - /** - * Gets the value(s) for name (Parameter name in service call). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The name of a parameter - *

- */ - public StringDt getName() { - if (myName == null) { - myName = new StringDt(); - } - return myName; - } - - /** - * Sets the value(s) for name (Parameter name in service call) - * - *

- * Definition: - * The name of a parameter - *

- */ - public ServiceParameter setName(StringDt theValue) { - myName = theValue; - return this; - } - - /** - * Sets the value for name (Parameter name in service call) - * - *

- * Definition: - * The name of a parameter - *

- */ - public ServiceParameter setName( String theString) { - myName = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for value (Parameter value for the name). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The value of the named parameter - *

- */ - public StringDt getValue() { - if (myValue == null) { - myValue = new StringDt(); - } - return myValue; - } - - /** - * Sets the value(s) for value (Parameter value for the name) - * - *

- * Definition: - * The value of the named parameter - *

- */ - public ServiceParameter setValue(StringDt theValue) { - myValue = theValue; - return this; - } - - /** - * Sets the value for value (Parameter value for the name) - * - *

- * Definition: - * The value of the named parameter - *

- */ - public ServiceParameter setValue( String theString) { - myValue = new StringDt(theString); - return this; - } - - - - } - - - - /** - * Block class for child element: DocumentReference.context (Clinical context of document) - * - *

- * Definition: - * The clinical context in which the document was prepared - *

- */ - @Block() - public static class Context extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="event", type=CodeableConceptDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Main Clinical Acts Documented", - formalDefinition="This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a \"History and Physical Report\" in which the procedure being documented is necessarily a \"History and Physical\" act" - ) - private java.util.List myEvent; - - @Child(name="period", type=PeriodDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Time of service that is being documented", - formalDefinition="The time period over which the service that is described by the document was provided" - ) - private PeriodDt myPeriod; - - @Child(name="facilityType", type=CodeableConceptDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Kind of facility where patient was seen", - formalDefinition="The kind of facility where the patient was seen" - ) - private CodeableConceptDt myFacilityType; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myEvent, myPeriod, myFacilityType); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myEvent, myPeriod, myFacilityType); - } - - /** - * Gets the value(s) for event (Main Clinical Acts Documented). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a \"History and Physical Report\" in which the procedure being documented is necessarily a \"History and Physical\" act - *

- */ - public java.util.List getEvent() { - if (myEvent == null) { - myEvent = new java.util.ArrayList(); - } - return myEvent; - } - - /** - * Sets the value(s) for event (Main Clinical Acts Documented) - * - *

- * Definition: - * This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a \"History and Physical Report\" in which the procedure being documented is necessarily a \"History and Physical\" act - *

- */ - public Context setEvent(java.util.List theValue) { - myEvent = theValue; - return this; - } - - /** - * Adds and returns a new value for event (Main Clinical Acts Documented) - * - *

- * Definition: - * This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a \"History and Physical Report\" in which the procedure being documented is necessarily a \"History and Physical\" act - *

- */ - public CodeableConceptDt addEvent() { - CodeableConceptDt newType = new CodeableConceptDt(); - getEvent().add(newType); - return newType; - } - - /** - * Gets the first repetition for event (Main Clinical Acts Documented), - * creating it if it does not already exist. - * - *

- * Definition: - * This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a \"History and Physical Report\" in which the procedure being documented is necessarily a \"History and Physical\" act - *

- */ - public CodeableConceptDt getEventFirstRep() { - if (getEvent().isEmpty()) { - return addEvent(); - } - return getEvent().get(0); - } - - /** - * Gets the value(s) for period (Time of service that is being documented). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The time period over which the service that is described by the document was provided - *

- */ - public PeriodDt getPeriod() { - if (myPeriod == null) { - myPeriod = new PeriodDt(); - } - return myPeriod; - } - - /** - * Sets the value(s) for period (Time of service that is being documented) - * - *

- * Definition: - * The time period over which the service that is described by the document was provided - *

- */ - public Context setPeriod(PeriodDt theValue) { - myPeriod = theValue; - return this; - } - - - /** - * Gets the value(s) for facilityType (Kind of facility where patient was seen). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The kind of facility where the patient was seen - *

- */ - public CodeableConceptDt getFacilityType() { - if (myFacilityType == null) { - myFacilityType = new CodeableConceptDt(); - } - return myFacilityType; - } - - /** - * Sets the value(s) for facilityType (Kind of facility where patient was seen) - * - *

- * Definition: - * The kind of facility where the patient was seen - *

- */ - public Context setFacilityType(CodeableConceptDt theValue) { - myFacilityType = theValue; - return this; - } - - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Encounter.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Encounter.java deleted file mode 100644 index a9a1a219fea..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Encounter.java +++ /dev/null @@ -1,2089 +0,0 @@ - - - - - - - - - - - - - - - - -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.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.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.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.DurationDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.AdmitSourceEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterClassEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterReasonCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterStateEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.ParticipantTypeEnum; -import ca.uhn.fhir.model.primitive.BooleanDt; -import ca.uhn.fhir.model.primitive.BoundCodeDt; -import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; -import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.rest.gclient.DateClientParam; -import ca.uhn.fhir.rest.gclient.NumberClientParam; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR Encounter Resource - * (An interaction during which services are provided to the patient) - * - *

- * Definition: - * An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Encounter - *

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

- * Description:
- * Type: token
- * Path: Encounter.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Encounter.identifier", description="", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - - /** - * Fluent Client search parameter constant for identifier - *

- * Description:
- * Type: token
- * Path: Encounter.identifier
- *

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

- * Description:
- * Type: token
- * Path: Encounter.status
- *

- */ - @SearchParamDefinition(name="status", path="Encounter.status", description="", type="token" ) - public static final String SP_STATUS = "status"; - - /** - * Fluent Client search parameter constant for status - *

- * Description:
- * Type: token
- * Path: Encounter.status
- *

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

- * Description: A date within the period the Encounter lasted
- * Type: date
- * Path: Encounter.period
- *

- */ - @SearchParamDefinition(name="date", path="Encounter.period", description="A date within the period the Encounter lasted", type="date" ) - public static final String SP_DATE = "date"; - - /** - * Fluent Client search parameter constant for date - *

- * Description: A date within the period the Encounter lasted
- * Type: date
- * Path: Encounter.period
- *

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

- * Description:
- * Type: reference
- * Path: Encounter.subject
- *

- */ - @SearchParamDefinition(name="subject", path="Encounter.subject", description="", type="reference" ) - public static final String SP_SUBJECT = "subject"; - - /** - * Fluent Client search parameter constant for subject - *

- * Description:
- * Type: reference
- * Path: Encounter.subject
- *

- */ - public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Encounter.subject". - */ - public static final Include INCLUDE_SUBJECT = new Include("Encounter.subject"); - - /** - * Search parameter constant for length - *

- * Description: Length of encounter in days
- * Type: number
- * Path: Encounter.length
- *

- */ - @SearchParamDefinition(name="length", path="Encounter.length", description="Length of encounter in days", type="number" ) - public static final String SP_LENGTH = "length"; - - /** - * Fluent Client search parameter constant for length - *

- * Description: Length of encounter in days
- * Type: number
- * Path: Encounter.length
- *

- */ - public static final NumberClientParam LENGTH = new NumberClientParam(SP_LENGTH); - - /** - * Search parameter constant for indication - *

- * Description:
- * Type: reference
- * Path: Encounter.indication
- *

- */ - @SearchParamDefinition(name="indication", path="Encounter.indication", description="", type="reference" ) - public static final String SP_INDICATION = "indication"; - - /** - * Fluent Client search parameter constant for indication - *

- * Description:
- * Type: reference
- * Path: Encounter.indication
- *

- */ - public static final ReferenceClientParam INDICATION = new ReferenceClientParam(SP_INDICATION); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Encounter.indication". - */ - public static final Include INCLUDE_INDICATION = new Include("Encounter.indication"); - - /** - * Search parameter constant for location - *

- * Description:
- * Type: reference
- * Path: Encounter.location.location
- *

- */ - @SearchParamDefinition(name="location", path="Encounter.location.location", description="", type="reference" ) - public static final String SP_LOCATION = "location"; - - /** - * Fluent Client search parameter constant for location - *

- * Description:
- * Type: reference
- * Path: Encounter.location.location
- *

- */ - public static final ReferenceClientParam LOCATION = new ReferenceClientParam(SP_LOCATION); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Encounter.location.location". - */ - public static final Include INCLUDE_LOCATION_LOCATION = new Include("Encounter.location.location"); - - /** - * Search parameter constant for location-period - *

- * Description:
- * Type: date
- * Path: Encounter.location.period
- *

- */ - @SearchParamDefinition(name="location-period", path="Encounter.location.period", description="", type="date" ) - public static final String SP_LOCATION_PERIOD = "location-period"; - - /** - * Fluent Client search parameter constant for location-period - *

- * Description:
- * Type: date
- * Path: Encounter.location.period
- *

- */ - public static final DateClientParam LOCATION_PERIOD = new DateClientParam(SP_LOCATION_PERIOD); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Identifier(s) by which this encounter is known", - formalDefinition="" - ) - private java.util.List myIdentifier; - - @Child(name="status", type=CodeDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="planned | in progress | onleave | finished | cancelled", - formalDefinition="" - ) - private BoundCodeDt myStatus; - - @Child(name="class", type=CodeDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="inpatient | outpatient | ambulatory | emergency +", - formalDefinition="" - ) - private BoundCodeDt myClassElement; - - @Child(name="type", type=CodeableConceptDt.class, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Specific type of encounter", - formalDefinition="Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation)" - ) - private java.util.List> myType; - - @Child(name="subject", order=4, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="The patient present at the encounter", - formalDefinition="" - ) - private ResourceReferenceDt mySubject; - - @Child(name="participant", order=5, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="List of participants involved in the encounter", - formalDefinition="The main practitioner responsible for providing the service" - ) - private java.util.List myParticipant; - - @Child(name="period", type=PeriodDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="The start and end time of the encounter", - formalDefinition="The start and end time of the encounter" - ) - private PeriodDt myPeriod; - - @Child(name="length", type=DurationDt.class, order=7, min=0, max=1) - @Description( - shortDefinition="Quantity of time the encounter lasted", - formalDefinition="Quantity of time the encounter lasted. This excludes the time during leaves of absence." - ) - private DurationDt myLength; - - @Child(name="reason", type=CodeableConceptDt.class, order=8, min=0, max=1) - @Description( - shortDefinition="Reason the encounter takes place (code)", - formalDefinition="Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis." - ) - private BoundCodeableConceptDt myReason; - - @Child(name="indication", order=9, min=0, max=1, type={ - IResource.class }) - @Description( - shortDefinition="Reason the encounter takes place (resource)", - formalDefinition="Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis." - ) - private ResourceReferenceDt myIndication; - - @Child(name="priority", type=CodeableConceptDt.class, order=10, min=0, max=1) - @Description( - shortDefinition="Indicates the urgency of the encounter", - formalDefinition="" - ) - private CodeableConceptDt myPriority; - - @Child(name="hospitalization", order=11, min=0, max=1) - @Description( - shortDefinition="Details about an admission to a clinic", - formalDefinition="Details about an admission to a clinic" - ) - private Hospitalization myHospitalization; - - @Child(name="location", order=12, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="List of locations the patient has been at", - formalDefinition="List of locations at which the patient has been" - ) - private java.util.List myLocation; - - @Child(name="serviceProvider", order=13, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Organization.class }) - @Description( - shortDefinition="Department or team providing care", - formalDefinition="" - ) - private ResourceReferenceDt myServiceProvider; - - @Child(name="partOf", order=14, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Encounter.class }) - @Description( - shortDefinition="Another Encounter this encounter is part of", - formalDefinition="Another Encounter of which this encounter is a part of (administratively or in time)." - ) - private ResourceReferenceDt myPartOf; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myStatus, myClassElement, myType, mySubject, myParticipant, myPeriod, myLength, myReason, myIndication, myPriority, myHospitalization, myLocation, myServiceProvider, myPartOf); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myStatus, myClassElement, myType, mySubject, myParticipant, myPeriod, myLength, myReason, myIndication, myPriority, myHospitalization, myLocation, myServiceProvider, myPartOf); - } - - /** - * Gets the value(s) for identifier (Identifier(s) by which this encounter is known). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Identifier(s) by which this encounter is known) - * - *

- * Definition: - * - *

- */ - public Encounter setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (Identifier(s) by which this encounter is known) - * - *

- * Definition: - * - *

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (Identifier(s) by which this encounter is known), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (Identifier(s) by which this encounter is known) - * - *

- * Definition: - * - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Encounter addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (Identifier(s) by which this encounter is known) - * - *

- * Definition: - * - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Encounter addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for status (planned | in progress | onleave | finished | cancelled). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public BoundCodeDt getStatus() { - if (myStatus == null) { - myStatus = new BoundCodeDt(EncounterStateEnum.VALUESET_BINDER); - } - return myStatus; - } - - /** - * Sets the value(s) for status (planned | in progress | onleave | finished | cancelled) - * - *

- * Definition: - * - *

- */ - public Encounter setStatus(BoundCodeDt theValue) { - myStatus = theValue; - return this; - } - - /** - * Sets the value(s) for status (planned | in progress | onleave | finished | cancelled) - * - *

- * Definition: - * - *

- */ - public Encounter setStatus(EncounterStateEnum theValue) { - getStatus().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for class (inpatient | outpatient | ambulatory | emergency +). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public BoundCodeDt getClassElement() { - if (myClassElement == null) { - myClassElement = new BoundCodeDt(EncounterClassEnum.VALUESET_BINDER); - } - return myClassElement; - } - - /** - * Sets the value(s) for class (inpatient | outpatient | ambulatory | emergency +) - * - *

- * Definition: - * - *

- */ - public Encounter setClassElement(BoundCodeDt theValue) { - myClassElement = theValue; - return this; - } - - /** - * Sets the value(s) for class (inpatient | outpatient | ambulatory | emergency +) - * - *

- * Definition: - * - *

- */ - public Encounter setClassElement(EncounterClassEnum theValue) { - getClassElement().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for type (Specific type of encounter). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation) - *

- */ - public java.util.List> getType() { - if (myType == null) { - myType = new java.util.ArrayList>(); - } - return myType; - } - - /** - * Sets the value(s) for type (Specific type of encounter) - * - *

- * Definition: - * Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation) - *

- */ - public Encounter setType(java.util.List> theValue) { - myType = theValue; - return this; - } - - /** - * Add a value for type (Specific type of encounter) 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: - * Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation) - *

- */ - public BoundCodeableConceptDt addType(EncounterTypeEnum theValue) { - BoundCodeableConceptDt retVal = new BoundCodeableConceptDt(EncounterTypeEnum.VALUESET_BINDER, theValue); - getType().add(retVal); - return retVal; - } - - /** - * Gets the first repetition for type (Specific type of encounter), - * creating it if it does not already exist. - * - *

- * Definition: - * Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation) - *

- */ - public BoundCodeableConceptDt getTypeFirstRep() { - if (getType().size() == 0) { - addType(); - } - return getType().get(0); - } - - /** - * Add a value for type (Specific type of encounter) - * - *

- * Definition: - * Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation) - *

- */ - public BoundCodeableConceptDt addType() { - BoundCodeableConceptDt retVal = new BoundCodeableConceptDt(EncounterTypeEnum.VALUESET_BINDER); - getType().add(retVal); - return retVal; - } - - /** - * Sets the value(s), and clears any existing value(s) for type (Specific type of encounter) - * - *

- * Definition: - * Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation) - *

- */ - public Encounter setType(EncounterTypeEnum theValue) { - getType().clear(); - addType(theValue); - return this; - } - - - /** - * Gets the value(s) for subject (The patient present at the encounter). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt getSubject() { - if (mySubject == null) { - mySubject = new ResourceReferenceDt(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (The patient present at the encounter) - * - *

- * Definition: - * - *

- */ - public Encounter setSubject(ResourceReferenceDt theValue) { - mySubject = theValue; - return this; - } - - - /** - * Gets the value(s) for participant (List of participants involved in the encounter). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getParticipant() { - if (myParticipant == null) { - myParticipant = new java.util.ArrayList(); - } - return myParticipant; - } - - /** - * Sets the value(s) for participant (List of participants involved in the encounter) - * - *

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

- */ - public Encounter setParticipant(java.util.List theValue) { - myParticipant = theValue; - return this; - } - - /** - * Adds and returns a new value for participant (List of participants involved in the encounter) - * - *

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

- */ - public Participant addParticipant() { - Participant newType = new Participant(); - getParticipant().add(newType); - return newType; - } - - /** - * Gets the first repetition for participant (List of participants involved in the encounter), - * creating it if it does not already exist. - * - *

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

- */ - public Participant getParticipantFirstRep() { - if (getParticipant().isEmpty()) { - return addParticipant(); - } - return getParticipant().get(0); - } - - /** - * Gets the value(s) for period (The start and end time of the encounter). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The start and end time of the encounter - *

- */ - public PeriodDt getPeriod() { - if (myPeriod == null) { - myPeriod = new PeriodDt(); - } - return myPeriod; - } - - /** - * Sets the value(s) for period (The start and end time of the encounter) - * - *

- * Definition: - * The start and end time of the encounter - *

- */ - public Encounter setPeriod(PeriodDt theValue) { - myPeriod = theValue; - return this; - } - - - /** - * Gets the value(s) for length (Quantity of time the encounter lasted). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Quantity of time the encounter lasted. This excludes the time during leaves of absence. - *

- */ - public DurationDt getLength() { - if (myLength == null) { - myLength = new DurationDt(); - } - return myLength; - } - - /** - * Sets the value(s) for length (Quantity of time the encounter lasted) - * - *

- * Definition: - * Quantity of time the encounter lasted. This excludes the time during leaves of absence. - *

- */ - public Encounter setLength(DurationDt theValue) { - myLength = theValue; - return this; - } - - - /** - * Gets the value(s) for reason (Reason the encounter takes place (code)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis. - *

- */ - public BoundCodeableConceptDt getReason() { - if (myReason == null) { - myReason = new BoundCodeableConceptDt(EncounterReasonCodesEnum.VALUESET_BINDER); - } - return myReason; - } - - /** - * Sets the value(s) for reason (Reason the encounter takes place (code)) - * - *

- * Definition: - * Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis. - *

- */ - public Encounter setReason(BoundCodeableConceptDt theValue) { - myReason = theValue; - return this; - } - - /** - * Sets the value(s) for reason (Reason the encounter takes place (code)) - * - *

- * Definition: - * Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis. - *

- */ - public Encounter setReason(EncounterReasonCodesEnum theValue) { - getReason().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for indication (Reason the encounter takes place (resource)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. - *

- */ - public ResourceReferenceDt getIndication() { - if (myIndication == null) { - myIndication = new ResourceReferenceDt(); - } - return myIndication; - } - - /** - * Sets the value(s) for indication (Reason the encounter takes place (resource)) - * - *

- * Definition: - * Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. - *

- */ - public Encounter setIndication(ResourceReferenceDt theValue) { - myIndication = theValue; - return this; - } - - - /** - * Gets the value(s) for priority (Indicates the urgency of the encounter). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public CodeableConceptDt getPriority() { - if (myPriority == null) { - myPriority = new CodeableConceptDt(); - } - return myPriority; - } - - /** - * Sets the value(s) for priority (Indicates the urgency of the encounter) - * - *

- * Definition: - * - *

- */ - public Encounter setPriority(CodeableConceptDt theValue) { - myPriority = theValue; - return this; - } - - - /** - * Gets the value(s) for hospitalization (Details about an admission to a clinic). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Details about an admission to a clinic - *

- */ - public Hospitalization getHospitalization() { - if (myHospitalization == null) { - myHospitalization = new Hospitalization(); - } - return myHospitalization; - } - - /** - * Sets the value(s) for hospitalization (Details about an admission to a clinic) - * - *

- * Definition: - * Details about an admission to a clinic - *

- */ - public Encounter setHospitalization(Hospitalization theValue) { - myHospitalization = theValue; - return this; - } - - - /** - * Gets the value(s) for location (List of locations the patient has been at). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getLocation() { - if (myLocation == null) { - myLocation = new java.util.ArrayList(); - } - return myLocation; - } - - /** - * Sets the value(s) for location (List of locations the patient has been at) - * - *

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

- */ - public Encounter setLocation(java.util.List theValue) { - myLocation = theValue; - return this; - } - - /** - * Adds and returns a new value for location (List of locations the patient has been at) - * - *

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

- */ - public Location addLocation() { - Location newType = new Location(); - getLocation().add(newType); - return newType; - } - - /** - * Gets the first repetition for location (List of locations the patient has been at), - * creating it if it does not already exist. - * - *

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

- */ - public Location getLocationFirstRep() { - if (getLocation().isEmpty()) { - return addLocation(); - } - return getLocation().get(0); - } - - /** - * Gets the value(s) for serviceProvider (Department or team providing care). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt getServiceProvider() { - if (myServiceProvider == null) { - myServiceProvider = new ResourceReferenceDt(); - } - return myServiceProvider; - } - - /** - * Sets the value(s) for serviceProvider (Department or team providing care) - * - *

- * Definition: - * - *

- */ - public Encounter setServiceProvider(ResourceReferenceDt theValue) { - myServiceProvider = theValue; - return this; - } - - - /** - * Gets the value(s) for partOf (Another Encounter this encounter is part of). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Another Encounter of which this encounter is a part of (administratively or in time). - *

- */ - public ResourceReferenceDt getPartOf() { - if (myPartOf == null) { - myPartOf = new ResourceReferenceDt(); - } - return myPartOf; - } - - /** - * Sets the value(s) for partOf (Another Encounter this encounter is part of) - * - *

- * Definition: - * Another Encounter of which this encounter is a part of (administratively or in time). - *

- */ - public Encounter setPartOf(ResourceReferenceDt theValue) { - myPartOf = theValue; - return this; - } - - - /** - * Block class for child element: Encounter.participant (List of participants involved in the encounter) - * - *

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

- */ - @Block() - public static class Participant extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="type", type=CodeableConceptDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Role of participant in encounter", - formalDefinition="" - ) - private java.util.List> myType; - - @Child(name="individual", order=1, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.RelatedPerson.class }) - @Description( - shortDefinition="Persons involved in the encounter other than the patient", - formalDefinition="" - ) - private ResourceReferenceDt myIndividual; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myType, myIndividual); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myType, myIndividual); - } - - /** - * Gets the value(s) for type (Role of participant in encounter). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List> getType() { - if (myType == null) { - myType = new java.util.ArrayList>(); - } - return myType; - } - - /** - * Sets the value(s) for type (Role of participant in encounter) - * - *

- * Definition: - * - *

- */ - public Participant setType(java.util.List> theValue) { - myType = theValue; - return this; - } - - /** - * Add a value for type (Role of participant in encounter) 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: - * - *

- */ - public BoundCodeableConceptDt addType(ParticipantTypeEnum theValue) { - BoundCodeableConceptDt retVal = new BoundCodeableConceptDt(ParticipantTypeEnum.VALUESET_BINDER, theValue); - getType().add(retVal); - return retVal; - } - - /** - * Gets the first repetition for type (Role of participant in encounter), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public BoundCodeableConceptDt getTypeFirstRep() { - if (getType().size() == 0) { - addType(); - } - return getType().get(0); - } - - /** - * Add a value for type (Role of participant in encounter) - * - *

- * Definition: - * - *

- */ - public BoundCodeableConceptDt addType() { - BoundCodeableConceptDt retVal = new BoundCodeableConceptDt(ParticipantTypeEnum.VALUESET_BINDER); - getType().add(retVal); - return retVal; - } - - /** - * Sets the value(s), and clears any existing value(s) for type (Role of participant in encounter) - * - *

- * Definition: - * - *

- */ - public Participant setType(ParticipantTypeEnum theValue) { - getType().clear(); - addType(theValue); - return this; - } - - - /** - * Gets the value(s) for individual (Persons involved in the encounter other than the patient). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt getIndividual() { - if (myIndividual == null) { - myIndividual = new ResourceReferenceDt(); - } - return myIndividual; - } - - /** - * Sets the value(s) for individual (Persons involved in the encounter other than the patient) - * - *

- * Definition: - * - *

- */ - public Participant setIndividual(ResourceReferenceDt theValue) { - myIndividual = theValue; - return this; - } - - - - } - - - /** - * Block class for child element: Encounter.hospitalization (Details about an admission to a clinic) - * - *

- * Definition: - * Details about an admission to a clinic - *

- */ - @Block() - public static class Hospitalization extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="preAdmissionIdentifier", type=IdentifierDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Pre-admission identifier", - formalDefinition="" - ) - private IdentifierDt myPreAdmissionIdentifier; - - @Child(name="origin", order=1, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Location.class }) - @Description( - shortDefinition="The location from which the patient came before admission", - formalDefinition="" - ) - private ResourceReferenceDt myOrigin; - - @Child(name="admitSource", type=CodeableConceptDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="From where patient was admitted (physician referral, transfer)", - formalDefinition="" - ) - private BoundCodeableConceptDt myAdmitSource; - - @Child(name="period", type=PeriodDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Period during which the patient was admitted", - formalDefinition="Period during which the patient was admitted" - ) - private PeriodDt myPeriod; - - @Child(name="accomodation", order=4, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Where the patient stays during this encounter", - formalDefinition="" - ) - private java.util.List myAccomodation; - - @Child(name="diet", type=CodeableConceptDt.class, order=5, min=0, max=1) - @Description( - shortDefinition="Dietary restrictions for the patient", - formalDefinition="Dietary restrictions for the patient" - ) - private CodeableConceptDt myDiet; - - @Child(name="specialCourtesy", type=CodeableConceptDt.class, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Special courtesies (VIP, board member)", - formalDefinition="" - ) - private java.util.List mySpecialCourtesy; - - @Child(name="specialArrangement", type=CodeableConceptDt.class, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Wheelchair, translator, stretcher, etc", - formalDefinition="" - ) - private java.util.List mySpecialArrangement; - - @Child(name="destination", order=8, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Location.class }) - @Description( - shortDefinition="Location to which the patient is discharged", - formalDefinition="" - ) - private ResourceReferenceDt myDestination; - - @Child(name="dischargeDisposition", type=CodeableConceptDt.class, order=9, min=0, max=1) - @Description( - shortDefinition="Category or kind of location after discharge", - formalDefinition="" - ) - private CodeableConceptDt myDischargeDisposition; - - @Child(name="dischargeDiagnosis", order=10, min=0, max=1, type={ - IResource.class }) - @Description( - shortDefinition="The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete", - formalDefinition="" - ) - private ResourceReferenceDt myDischargeDiagnosis; - - @Child(name="reAdmission", type=BooleanDt.class, order=11, min=0, max=1) - @Description( - shortDefinition="Is this hospitalization a readmission?", - formalDefinition="Whether this hospitalization is a readmission" - ) - private BooleanDt myReAdmission; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myPreAdmissionIdentifier, myOrigin, myAdmitSource, myPeriod, myAccomodation, myDiet, mySpecialCourtesy, mySpecialArrangement, myDestination, myDischargeDisposition, myDischargeDiagnosis, myReAdmission); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myPreAdmissionIdentifier, myOrigin, myAdmitSource, myPeriod, myAccomodation, myDiet, mySpecialCourtesy, mySpecialArrangement, myDestination, myDischargeDisposition, myDischargeDiagnosis, myReAdmission); - } - - /** - * Gets the value(s) for preAdmissionIdentifier (Pre-admission identifier). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public IdentifierDt getPreAdmissionIdentifier() { - if (myPreAdmissionIdentifier == null) { - myPreAdmissionIdentifier = new IdentifierDt(); - } - return myPreAdmissionIdentifier; - } - - /** - * Sets the value(s) for preAdmissionIdentifier (Pre-admission identifier) - * - *

- * Definition: - * - *

- */ - public Hospitalization setPreAdmissionIdentifier(IdentifierDt theValue) { - myPreAdmissionIdentifier = theValue; - return this; - } - - /** - * Sets the value for preAdmissionIdentifier (Pre-admission identifier) - * - *

- * Definition: - * - *

- */ - public Hospitalization setPreAdmissionIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - myPreAdmissionIdentifier = new IdentifierDt(theUse, theSystem, theValue, theLabel); - return this; - } - - /** - * Sets the value for preAdmissionIdentifier (Pre-admission identifier) - * - *

- * Definition: - * - *

- */ - public Hospitalization setPreAdmissionIdentifier( String theSystem, String theValue) { - myPreAdmissionIdentifier = new IdentifierDt(theSystem, theValue); - return this; - } - - - /** - * Gets the value(s) for origin (The location from which the patient came before admission). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt getOrigin() { - if (myOrigin == null) { - myOrigin = new ResourceReferenceDt(); - } - return myOrigin; - } - - /** - * Sets the value(s) for origin (The location from which the patient came before admission) - * - *

- * Definition: - * - *

- */ - public Hospitalization setOrigin(ResourceReferenceDt theValue) { - myOrigin = theValue; - return this; - } - - - /** - * Gets the value(s) for admitSource (From where patient was admitted (physician referral, transfer)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public BoundCodeableConceptDt getAdmitSource() { - if (myAdmitSource == null) { - myAdmitSource = new BoundCodeableConceptDt(AdmitSourceEnum.VALUESET_BINDER); - } - return myAdmitSource; - } - - /** - * Sets the value(s) for admitSource (From where patient was admitted (physician referral, transfer)) - * - *

- * Definition: - * - *

- */ - public Hospitalization setAdmitSource(BoundCodeableConceptDt theValue) { - myAdmitSource = theValue; - return this; - } - - /** - * Sets the value(s) for admitSource (From where patient was admitted (physician referral, transfer)) - * - *

- * Definition: - * - *

- */ - public Hospitalization setAdmitSource(AdmitSourceEnum theValue) { - getAdmitSource().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for period (Period during which the patient was admitted). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Period during which the patient was admitted - *

- */ - public PeriodDt getPeriod() { - if (myPeriod == null) { - myPeriod = new PeriodDt(); - } - return myPeriod; - } - - /** - * Sets the value(s) for period (Period during which the patient was admitted) - * - *

- * Definition: - * Period during which the patient was admitted - *

- */ - public Hospitalization setPeriod(PeriodDt theValue) { - myPeriod = theValue; - return this; - } - - - /** - * Gets the value(s) for accomodation (Where the patient stays during this encounter). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getAccomodation() { - if (myAccomodation == null) { - myAccomodation = new java.util.ArrayList(); - } - return myAccomodation; - } - - /** - * Sets the value(s) for accomodation (Where the patient stays during this encounter) - * - *

- * Definition: - * - *

- */ - public Hospitalization setAccomodation(java.util.List theValue) { - myAccomodation = theValue; - return this; - } - - /** - * Adds and returns a new value for accomodation (Where the patient stays during this encounter) - * - *

- * Definition: - * - *

- */ - public HospitalizationAccomodation addAccomodation() { - HospitalizationAccomodation newType = new HospitalizationAccomodation(); - getAccomodation().add(newType); - return newType; - } - - /** - * Gets the first repetition for accomodation (Where the patient stays during this encounter), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public HospitalizationAccomodation getAccomodationFirstRep() { - if (getAccomodation().isEmpty()) { - return addAccomodation(); - } - return getAccomodation().get(0); - } - - /** - * Gets the value(s) for diet (Dietary restrictions for the patient). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Dietary restrictions for the patient - *

- */ - public CodeableConceptDt getDiet() { - if (myDiet == null) { - myDiet = new CodeableConceptDt(); - } - return myDiet; - } - - /** - * Sets the value(s) for diet (Dietary restrictions for the patient) - * - *

- * Definition: - * Dietary restrictions for the patient - *

- */ - public Hospitalization setDiet(CodeableConceptDt theValue) { - myDiet = theValue; - return this; - } - - - /** - * Gets the value(s) for specialCourtesy (Special courtesies (VIP, board member)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getSpecialCourtesy() { - if (mySpecialCourtesy == null) { - mySpecialCourtesy = new java.util.ArrayList(); - } - return mySpecialCourtesy; - } - - /** - * Sets the value(s) for specialCourtesy (Special courtesies (VIP, board member)) - * - *

- * Definition: - * - *

- */ - public Hospitalization setSpecialCourtesy(java.util.List theValue) { - mySpecialCourtesy = theValue; - return this; - } - - /** - * Adds and returns a new value for specialCourtesy (Special courtesies (VIP, board member)) - * - *

- * Definition: - * - *

- */ - public CodeableConceptDt addSpecialCourtesy() { - CodeableConceptDt newType = new CodeableConceptDt(); - getSpecialCourtesy().add(newType); - return newType; - } - - /** - * Gets the first repetition for specialCourtesy (Special courtesies (VIP, board member)), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public CodeableConceptDt getSpecialCourtesyFirstRep() { - if (getSpecialCourtesy().isEmpty()) { - return addSpecialCourtesy(); - } - return getSpecialCourtesy().get(0); - } - - /** - * Gets the value(s) for specialArrangement (Wheelchair, translator, stretcher, etc). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getSpecialArrangement() { - if (mySpecialArrangement == null) { - mySpecialArrangement = new java.util.ArrayList(); - } - return mySpecialArrangement; - } - - /** - * Sets the value(s) for specialArrangement (Wheelchair, translator, stretcher, etc) - * - *

- * Definition: - * - *

- */ - public Hospitalization setSpecialArrangement(java.util.List theValue) { - mySpecialArrangement = theValue; - return this; - } - - /** - * Adds and returns a new value for specialArrangement (Wheelchair, translator, stretcher, etc) - * - *

- * Definition: - * - *

- */ - public CodeableConceptDt addSpecialArrangement() { - CodeableConceptDt newType = new CodeableConceptDt(); - getSpecialArrangement().add(newType); - return newType; - } - - /** - * Gets the first repetition for specialArrangement (Wheelchair, translator, stretcher, etc), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public CodeableConceptDt getSpecialArrangementFirstRep() { - if (getSpecialArrangement().isEmpty()) { - return addSpecialArrangement(); - } - return getSpecialArrangement().get(0); - } - - /** - * Gets the value(s) for destination (Location to which the patient is discharged). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt getDestination() { - if (myDestination == null) { - myDestination = new ResourceReferenceDt(); - } - return myDestination; - } - - /** - * Sets the value(s) for destination (Location to which the patient is discharged) - * - *

- * Definition: - * - *

- */ - public Hospitalization setDestination(ResourceReferenceDt theValue) { - myDestination = theValue; - return this; - } - - - /** - * Gets the value(s) for dischargeDisposition (Category or kind of location after discharge). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public CodeableConceptDt getDischargeDisposition() { - if (myDischargeDisposition == null) { - myDischargeDisposition = new CodeableConceptDt(); - } - return myDischargeDisposition; - } - - /** - * Sets the value(s) for dischargeDisposition (Category or kind of location after discharge) - * - *

- * Definition: - * - *

- */ - public Hospitalization setDischargeDisposition(CodeableConceptDt theValue) { - myDischargeDisposition = theValue; - return this; - } - - - /** - * Gets the value(s) for dischargeDiagnosis (The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt getDischargeDiagnosis() { - if (myDischargeDiagnosis == null) { - myDischargeDiagnosis = new ResourceReferenceDt(); - } - return myDischargeDiagnosis; - } - - /** - * Sets the value(s) for dischargeDiagnosis (The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete) - * - *

- * Definition: - * - *

- */ - public Hospitalization setDischargeDiagnosis(ResourceReferenceDt theValue) { - myDischargeDiagnosis = theValue; - return this; - } - - - /** - * Gets the value(s) for reAdmission (Is this hospitalization a readmission?). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Whether this hospitalization is a readmission - *

- */ - public BooleanDt getReAdmission() { - if (myReAdmission == null) { - myReAdmission = new BooleanDt(); - } - return myReAdmission; - } - - /** - * Sets the value(s) for reAdmission (Is this hospitalization a readmission?) - * - *

- * Definition: - * Whether this hospitalization is a readmission - *

- */ - public Hospitalization setReAdmission(BooleanDt theValue) { - myReAdmission = theValue; - return this; - } - - /** - * Sets the value for reAdmission (Is this hospitalization a readmission?) - * - *

- * Definition: - * Whether this hospitalization is a readmission - *

- */ - public Hospitalization setReAdmission( boolean theBoolean) { - myReAdmission = new BooleanDt(theBoolean); - return this; - } - - - - } - - /** - * Block class for child element: Encounter.hospitalization.accomodation (Where the patient stays during this encounter) - * - *

- * Definition: - * - *

- */ - @Block() - public static class HospitalizationAccomodation extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="bed", order=0, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Location.class }) - @Description( - shortDefinition="The bed that is assigned to the patient", - formalDefinition="" - ) - private ResourceReferenceDt myBed; - - @Child(name="period", type=PeriodDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Period during which the patient was assigned the bed", - formalDefinition="" - ) - private PeriodDt myPeriod; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myBed, myPeriod); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myBed, myPeriod); - } - - /** - * Gets the value(s) for bed (The bed that is assigned to the patient). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt getBed() { - if (myBed == null) { - myBed = new ResourceReferenceDt(); - } - return myBed; - } - - /** - * Sets the value(s) for bed (The bed that is assigned to the patient) - * - *

- * Definition: - * - *

- */ - public HospitalizationAccomodation setBed(ResourceReferenceDt theValue) { - myBed = theValue; - return this; - } - - - /** - * Gets the value(s) for period (Period during which the patient was assigned the bed). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public PeriodDt getPeriod() { - if (myPeriod == null) { - myPeriod = new PeriodDt(); - } - return myPeriod; - } - - /** - * Sets the value(s) for period (Period during which the patient was assigned the bed) - * - *

- * Definition: - * - *

- */ - public HospitalizationAccomodation setPeriod(PeriodDt theValue) { - myPeriod = theValue; - return this; - } - - - - } - - - - /** - * Block class for child element: Encounter.location (List of locations the patient has been at) - * - *

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

- */ - @Block() - public static class Location extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="location", order=0, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Location.class }) - @Description( - shortDefinition="Location the encounter takes place", - formalDefinition="The location where the encounter takes place" - ) - private ResourceReferenceDt myLocation; - - @Child(name="period", type=PeriodDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="Time period during which the patient was present at the location", - formalDefinition="" - ) - private PeriodDt myPeriod; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myLocation, myPeriod); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myLocation, myPeriod); - } - - /** - * Gets the value(s) for location (Location the encounter takes place). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The location where the encounter takes place - *

- */ - public ResourceReferenceDt getLocation() { - if (myLocation == null) { - myLocation = new ResourceReferenceDt(); - } - return myLocation; - } - - /** - * Sets the value(s) for location (Location the encounter takes place) - * - *

- * Definition: - * The location where the encounter takes place - *

- */ - public Location setLocation(ResourceReferenceDt theValue) { - myLocation = theValue; - return this; - } - - - /** - * Gets the value(s) for period (Time period during which the patient was present at the location). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public PeriodDt getPeriod() { - if (myPeriod == null) { - myPeriod = new PeriodDt(); - } - return myPeriod; - } - - /** - * Sets the value(s) for period (Time period during which the patient was present at the location) - * - *

- * Definition: - * - *

- */ - public Location setPeriod(PeriodDt theValue) { - myPeriod = theValue; - return this; - } - - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/FamilyHistory.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/FamilyHistory.java deleted file mode 100644 index 6ae8e650076..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/FamilyHistory.java +++ /dev/null @@ -1,885 +0,0 @@ - - - - - - - - - - - - - - - - -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.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.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.AgeDt; -import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.composite.RangeDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.primitive.BooleanDt; -import ca.uhn.fhir.model.primitive.DateDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; - - -/** - * HAPI/FHIR FamilyHistory Resource - * (Information about patient's relatives, relevant for patient) - * - *

- * Definition: - * Significant health events and conditions for people related to the subject relevant in the context of care for the subject - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/FamilyHistory - *

- * - */ -@ResourceDef(name="FamilyHistory", profile="http://hl7.org/fhir/profiles/FamilyHistory", id="familyhistory") -public class FamilyHistory extends BaseResource implements IResource { - - /** - * Search parameter constant for subject - *

- * Description: The identity of a subject to list family history items for
- * Type: reference
- * Path: FamilyHistory.subject
- *

- */ - @SearchParamDefinition(name="subject", path="FamilyHistory.subject", description="The identity of a subject to list family history items for", type="reference" ) - public static final String SP_SUBJECT = "subject"; - - /** - * Fluent Client search parameter constant for subject - *

- * Description: The identity of a subject to list family history items for
- * Type: reference
- * Path: FamilyHistory.subject
- *

- */ - public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "FamilyHistory.subject". - */ - public static final Include INCLUDE_SUBJECT = new Include("FamilyHistory.subject"); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="External Id(s) for this record", - formalDefinition="This records identifiers associated with this family history record that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)" - ) - private java.util.List myIdentifier; - - @Child(name="subject", order=1, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="Patient history is about", - formalDefinition="The person who this history concerns" - ) - private ResourceReferenceDt mySubject; - - @Child(name="note", type=StringDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Additional details not covered elsewhere", - formalDefinition="Conveys information about family history not specific to individual relations." - ) - private StringDt myNote; - - @Child(name="relation", order=3, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Relative described by history", - formalDefinition="The related person. Each FamilyHistory resource contains the entire family history for a single person." - ) - private java.util.List myRelation; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, mySubject, myNote, myRelation); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, mySubject, myNote, myRelation); - } - - /** - * Gets the value(s) for identifier (External Id(s) for this record). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * This records identifiers associated with this family history record that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (External Id(s) for this record) - * - *

- * Definition: - * This records identifiers associated with this family history record that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public FamilyHistory setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (External Id(s) for this record) - * - *

- * Definition: - * This records identifiers associated with this family history record that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (External Id(s) for this record), - * creating it if it does not already exist. - * - *

- * Definition: - * This records identifiers associated with this family history record that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (External Id(s) for this record) - * - *

- * Definition: - * This records identifiers associated with this family history record that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public FamilyHistory addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (External Id(s) for this record) - * - *

- * Definition: - * This records identifiers associated with this family history record that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public FamilyHistory addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for subject (Patient history is about). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The person who this history concerns - *

- */ - public ResourceReferenceDt getSubject() { - if (mySubject == null) { - mySubject = new ResourceReferenceDt(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (Patient history is about) - * - *

- * Definition: - * The person who this history concerns - *

- */ - public FamilyHistory setSubject(ResourceReferenceDt theValue) { - mySubject = theValue; - return this; - } - - - /** - * Gets the value(s) for note (Additional details not covered elsewhere). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Conveys information about family history not specific to individual relations. - *

- */ - public StringDt getNote() { - if (myNote == null) { - myNote = new StringDt(); - } - return myNote; - } - - /** - * Sets the value(s) for note (Additional details not covered elsewhere) - * - *

- * Definition: - * Conveys information about family history not specific to individual relations. - *

- */ - public FamilyHistory setNote(StringDt theValue) { - myNote = theValue; - return this; - } - - /** - * Sets the value for note (Additional details not covered elsewhere) - * - *

- * Definition: - * Conveys information about family history not specific to individual relations. - *

- */ - public FamilyHistory setNote( String theString) { - myNote = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for relation (Relative described by history). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The related person. Each FamilyHistory resource contains the entire family history for a single person. - *

- */ - public java.util.List getRelation() { - if (myRelation == null) { - myRelation = new java.util.ArrayList(); - } - return myRelation; - } - - /** - * Sets the value(s) for relation (Relative described by history) - * - *

- * Definition: - * The related person. Each FamilyHistory resource contains the entire family history for a single person. - *

- */ - public FamilyHistory setRelation(java.util.List theValue) { - myRelation = theValue; - return this; - } - - /** - * Adds and returns a new value for relation (Relative described by history) - * - *

- * Definition: - * The related person. Each FamilyHistory resource contains the entire family history for a single person. - *

- */ - public Relation addRelation() { - Relation newType = new Relation(); - getRelation().add(newType); - return newType; - } - - /** - * Gets the first repetition for relation (Relative described by history), - * creating it if it does not already exist. - * - *

- * Definition: - * The related person. Each FamilyHistory resource contains the entire family history for a single person. - *

- */ - public Relation getRelationFirstRep() { - if (getRelation().isEmpty()) { - return addRelation(); - } - return getRelation().get(0); - } - - /** - * Block class for child element: FamilyHistory.relation (Relative described by history) - * - *

- * Definition: - * The related person. Each FamilyHistory resource contains the entire family history for a single person. - *

- */ - @Block() - public static class Relation extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="name", type=StringDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="The family member described", - formalDefinition="This will either be a name or a description. E.g. \"Aunt Susan\", \"my cousin with the red hair\"" - ) - private StringDt myName; - - @Child(name="relationship", type=CodeableConceptDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="Relationship to the subject", - formalDefinition="The type of relationship this person has to the patient (father, mother, brother etc.)" - ) - private CodeableConceptDt myRelationship; - - @Child(name="born", order=2, min=0, max=1, type={ - PeriodDt.class, DateDt.class, StringDt.class }) - @Description( - shortDefinition="(approximate) date of birth", - formalDefinition="The actual or approximate date of birth of the relative" - ) - private IDatatype myBorn; - - @Child(name="deceased", order=3, min=0, max=1, type={ - BooleanDt.class, AgeDt.class, RangeDt.class, DateDt.class, StringDt.class }) - @Description( - shortDefinition="Dead? How old/when?", - formalDefinition="If this resource is indicating that the related person is deceased, then an indicator of whether the person is deceased (yes) or not (no) or the age or age range or description of age at death - can be indicated here. If the reason for death is known, then it can be indicated in the outcome code of the condition - in this case the deceased property should still be set." - ) - private IDatatype myDeceased; - - @Child(name="note", type=StringDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="General note about related person", - formalDefinition="This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible." - ) - private StringDt myNote; - - @Child(name="condition", order=5, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Condition that the related person had", - formalDefinition="The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition." - ) - private java.util.List myCondition; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myName, myRelationship, myBorn, myDeceased, myNote, myCondition); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myName, myRelationship, myBorn, myDeceased, myNote, myCondition); - } - - /** - * Gets the value(s) for name (The family member described). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * This will either be a name or a description. E.g. \"Aunt Susan\", \"my cousin with the red hair\" - *

- */ - public StringDt getName() { - if (myName == null) { - myName = new StringDt(); - } - return myName; - } - - /** - * Sets the value(s) for name (The family member described) - * - *

- * Definition: - * This will either be a name or a description. E.g. \"Aunt Susan\", \"my cousin with the red hair\" - *

- */ - public Relation setName(StringDt theValue) { - myName = theValue; - return this; - } - - /** - * Sets the value for name (The family member described) - * - *

- * Definition: - * This will either be a name or a description. E.g. \"Aunt Susan\", \"my cousin with the red hair\" - *

- */ - public Relation setName( String theString) { - myName = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for relationship (Relationship to the subject). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The type of relationship this person has to the patient (father, mother, brother etc.) - *

- */ - public CodeableConceptDt getRelationship() { - if (myRelationship == null) { - myRelationship = new CodeableConceptDt(); - } - return myRelationship; - } - - /** - * Sets the value(s) for relationship (Relationship to the subject) - * - *

- * Definition: - * The type of relationship this person has to the patient (father, mother, brother etc.) - *

- */ - public Relation setRelationship(CodeableConceptDt theValue) { - myRelationship = theValue; - return this; - } - - - /** - * Gets the value(s) for born[x] ((approximate) date of birth). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The actual or approximate date of birth of the relative - *

- */ - public IDatatype getBorn() { - return myBorn; - } - - /** - * Sets the value(s) for born[x] ((approximate) date of birth) - * - *

- * Definition: - * The actual or approximate date of birth of the relative - *

- */ - public Relation setBorn(IDatatype theValue) { - myBorn = theValue; - return this; - } - - - /** - * Gets the value(s) for deceased[x] (Dead? How old/when?). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * If this resource is indicating that the related person is deceased, then an indicator of whether the person is deceased (yes) or not (no) or the age or age range or description of age at death - can be indicated here. If the reason for death is known, then it can be indicated in the outcome code of the condition - in this case the deceased property should still be set. - *

- */ - public IDatatype getDeceased() { - return myDeceased; - } - - /** - * Sets the value(s) for deceased[x] (Dead? How old/when?) - * - *

- * Definition: - * If this resource is indicating that the related person is deceased, then an indicator of whether the person is deceased (yes) or not (no) or the age or age range or description of age at death - can be indicated here. If the reason for death is known, then it can be indicated in the outcome code of the condition - in this case the deceased property should still be set. - *

- */ - public Relation setDeceased(IDatatype theValue) { - myDeceased = theValue; - return this; - } - - - /** - * Gets the value(s) for note (General note about related person). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible. - *

- */ - public StringDt getNote() { - if (myNote == null) { - myNote = new StringDt(); - } - return myNote; - } - - /** - * Sets the value(s) for note (General note about related person) - * - *

- * Definition: - * This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible. - *

- */ - public Relation setNote(StringDt theValue) { - myNote = theValue; - return this; - } - - /** - * Sets the value for note (General note about related person) - * - *

- * Definition: - * This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible. - *

- */ - public Relation setNote( String theString) { - myNote = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for condition (Condition that the related person had). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition. - *

- */ - public java.util.List getCondition() { - if (myCondition == null) { - myCondition = new java.util.ArrayList(); - } - return myCondition; - } - - /** - * Sets the value(s) for condition (Condition that the related person had) - * - *

- * Definition: - * The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition. - *

- */ - public Relation setCondition(java.util.List theValue) { - myCondition = theValue; - return this; - } - - /** - * Adds and returns a new value for condition (Condition that the related person had) - * - *

- * Definition: - * The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition. - *

- */ - public RelationCondition addCondition() { - RelationCondition newType = new RelationCondition(); - getCondition().add(newType); - return newType; - } - - /** - * Gets the first repetition for condition (Condition that the related person had), - * creating it if it does not already exist. - * - *

- * Definition: - * The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition. - *

- */ - public RelationCondition getConditionFirstRep() { - if (getCondition().isEmpty()) { - return addCondition(); - } - return getCondition().get(0); - } - - - } - - /** - * Block class for child element: FamilyHistory.relation.condition (Condition that the related person had) - * - *

- * Definition: - * The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition. - *

- */ - @Block() - public static class RelationCondition extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="type", type=CodeableConceptDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Condition suffered by relation", - formalDefinition="The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system" - ) - private CodeableConceptDt myType; - - @Child(name="outcome", type=CodeableConceptDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="deceased | permanent disability | etc.", - formalDefinition="Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation." - ) - private CodeableConceptDt myOutcome; - - @Child(name="onset", order=2, min=0, max=1, type={ - AgeDt.class, RangeDt.class, StringDt.class }) - @Description( - shortDefinition="When condition first manifested", - formalDefinition="Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence." - ) - private IDatatype myOnset; - - @Child(name="note", type=StringDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Extra information about condition", - formalDefinition="An area where general notes can be placed about this specific condition." - ) - private StringDt myNote; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myType, myOutcome, myOnset, myNote); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myType, myOutcome, myOnset, myNote); - } - - /** - * Gets the value(s) for type (Condition suffered by relation). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system - *

- */ - public CodeableConceptDt getType() { - if (myType == null) { - myType = new CodeableConceptDt(); - } - return myType; - } - - /** - * Sets the value(s) for type (Condition suffered by relation) - * - *

- * Definition: - * The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system - *

- */ - public RelationCondition setType(CodeableConceptDt theValue) { - myType = theValue; - return this; - } - - - /** - * Gets the value(s) for outcome (deceased | permanent disability | etc.). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation. - *

- */ - public CodeableConceptDt getOutcome() { - if (myOutcome == null) { - myOutcome = new CodeableConceptDt(); - } - return myOutcome; - } - - /** - * Sets the value(s) for outcome (deceased | permanent disability | etc.) - * - *

- * Definition: - * Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation. - *

- */ - public RelationCondition setOutcome(CodeableConceptDt theValue) { - myOutcome = theValue; - return this; - } - - - /** - * Gets the value(s) for onset[x] (When condition first manifested). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence. - *

- */ - public IDatatype getOnset() { - return myOnset; - } - - /** - * Sets the value(s) for onset[x] (When condition first manifested) - * - *

- * Definition: - * Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence. - *

- */ - public RelationCondition setOnset(IDatatype theValue) { - myOnset = theValue; - return this; - } - - - /** - * Gets the value(s) for note (Extra information about condition). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * An area where general notes can be placed about this specific condition. - *

- */ - public StringDt getNote() { - if (myNote == null) { - myNote = new StringDt(); - } - return myNote; - } - - /** - * Sets the value(s) for note (Extra information about condition) - * - *

- * Definition: - * An area where general notes can be placed about this specific condition. - *

- */ - public RelationCondition setNote(StringDt theValue) { - myNote = theValue; - return this; - } - - /** - * Sets the value for note (Extra information about condition) - * - *

- * Definition: - * An area where general notes can be placed about this specific condition. - *

- */ - public RelationCondition setNote( String theString) { - myNote = new StringDt(theString); - return this; - } - - - - } - - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GVFMeta.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GVFMeta.java deleted file mode 100644 index d2e88ecb018..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GVFMeta.java +++ /dev/null @@ -1,1554 +0,0 @@ - - - - - - - - - - - - - - - - -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.dstu.composite.AttachmentDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.DateDt; -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.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.StringClientParam; - - -/** - * HAPI/FHIR GVFMeta Resource - * (Meta data of a GVF file) - * - *

- * Definition: - * Pragmas from a GVF - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/GVFMeta - *

- * - */ -@ResourceDef(name="GVFMeta", profile="http://hl7.org/fhir/profiles/GVFMeta", id="gvfmeta") -public class GVFMeta extends BaseResource implements IResource { - - /** - * Search parameter constant for patient - *

- * Description: Patient being described in the file
- * Type: reference
- * Path: GVFMeta.subject.patient
- *

- */ - @SearchParamDefinition(name="patient", path="GVFMeta.subject.patient", description="Patient being described in the file", type="reference" ) - public static final String SP_PATIENT = "patient"; - - /** - * Fluent Client search parameter constant for patient - *

- * Description: Patient being described in the file
- * Type: reference
- * Path: GVFMeta.subject.patient
- *

- */ - public static final ReferenceClientParam PATIENT = new ReferenceClientParam(SP_PATIENT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "GVFMeta.subject.patient". - */ - public static final Include INCLUDE_SUBJECT_PATIENT = new Include("GVFMeta.subject.patient"); - - /** - * Search parameter constant for file - *

- * Description: URL to source file of the resource
- * Type: string
- * Path: GVFMeta.sourceFile
- *

- */ - @SearchParamDefinition(name="file", path="GVFMeta.sourceFile", description="URL to source file of the resource", type="string" ) - public static final String SP_FILE = "file"; - - /** - * Fluent Client search parameter constant for file - *

- * Description: URL to source file of the resource
- * Type: string
- * Path: GVFMeta.sourceFile
- *

- */ - public static final StringClientParam FILE = new StringClientParam(SP_FILE); - - - @Child(name="subject", order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Subject being described by the file", - formalDefinition="Subject being described by the file" - ) - private java.util.List mySubject; - - @Child(name="sourceFile", type=AttachmentDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="Source GVF file", - formalDefinition="GVF file from which data of the resource is extracted" - ) - private AttachmentDt mySourceFile; - - @Child(name="gvfVersion", type=CodeDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Version of the GVF file", - formalDefinition="Valid version of the GVF file" - ) - private CodeDt myGvfVersion; - - @Child(name="referenceFasta", type=UriDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="FASTA file used as reference assembly", - formalDefinition="URL to FASTA file used as reference assembly" - ) - private UriDt myReferenceFasta; - - @Child(name="featureGFF3", type=UriDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="GFF3 file containing feature being described in the file", - formalDefinition="GFF3 file containing feature being described in the file" - ) - private UriDt myFeatureGFF3; - - @Child(name="fileDate", type=DateDt.class, order=5, min=0, max=1) - @Description( - shortDefinition="Date when the file is updated", - formalDefinition="Date when the file is updated" - ) - private DateDt myFileDate; - - @Child(name="individual", type=StringDt.class, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Id of individual being described in the file", - formalDefinition="Id of individual being described in the file" - ) - private java.util.List myIndividual; - - @Child(name="population", type=CodeDt.class, order=7, min=0, max=1) - @Description( - shortDefinition="Code for population which the individual can be categorized into", - formalDefinition="Code for population which the individual can be categorized into" - ) - private CodeDt myPopulation; - - @Child(name="platform", order=8, min=0, max=1) - @Description( - shortDefinition="Sequencing platform", - formalDefinition="Technology platform used in the sequencing" - ) - private Platform myPlatform; - - @Child(name="sequencingScope", type=CodeDt.class, order=9, min=0, max=1) - @Description( - shortDefinition="Sequencing scope", - formalDefinition="Scope of the sequencing" - ) - private CodeDt mySequencingScope; - - @Child(name="captureMethod", type=CodeDt.class, order=10, min=0, max=1) - @Description( - shortDefinition="Capture method", - formalDefinition="Capture method used in the sequencing" - ) - private CodeDt myCaptureMethod; - - @Child(name="captureRegions", type=UriDt.class, order=11, min=0, max=1) - @Description( - shortDefinition="Region captured in the file", - formalDefinition="Region captured in the file" - ) - private UriDt myCaptureRegions; - - @Child(name="sequenceAlignment", type=StringDt.class, order=12, min=0, max=1) - @Description( - shortDefinition="Sequence alignment algorithm/pipline used", - formalDefinition="Sequence alignment algorithm/pipline used" - ) - private StringDt mySequenceAlignment; - - @Child(name="variantCalling", type=StringDt.class, order=13, min=0, max=1) - @Description( - shortDefinition="Pipline used for variant calling", - formalDefinition="Pipline used for variant calling" - ) - private StringDt myVariantCalling; - - @Child(name="sampleDescription", type=StringDt.class, order=14, min=0, max=1) - @Description( - shortDefinition="Description of sample used in the sequencing", - formalDefinition="Description of sample used in the sequencing" - ) - private StringDt mySampleDescription; - - @Child(name="genomicSource", type=CodeDt.class, order=15, min=0, max=1) - @Description( - shortDefinition="Source of the sample", - formalDefinition="Source of the sample" - ) - private CodeDt myGenomicSource; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySubject, mySourceFile, myGvfVersion, myReferenceFasta, myFeatureGFF3, myFileDate, myIndividual, myPopulation, myPlatform, mySequencingScope, myCaptureMethod, myCaptureRegions, mySequenceAlignment, myVariantCalling, mySampleDescription, myGenomicSource); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySubject, mySourceFile, myGvfVersion, myReferenceFasta, myFeatureGFF3, myFileDate, myIndividual, myPopulation, myPlatform, mySequencingScope, myCaptureMethod, myCaptureRegions, mySequenceAlignment, myVariantCalling, mySampleDescription, myGenomicSource); - } - - /** - * Gets the value(s) for subject (Subject being described by the file). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Subject being described by the file - *

- */ - public java.util.List getSubject() { - if (mySubject == null) { - mySubject = new java.util.ArrayList(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (Subject being described by the file) - * - *

- * Definition: - * Subject being described by the file - *

- */ - public GVFMeta setSubject(java.util.List theValue) { - mySubject = theValue; - return this; - } - - /** - * Adds and returns a new value for subject (Subject being described by the file) - * - *

- * Definition: - * Subject being described by the file - *

- */ - public Subject addSubject() { - Subject newType = new Subject(); - getSubject().add(newType); - return newType; - } - - /** - * Gets the first repetition for subject (Subject being described by the file), - * creating it if it does not already exist. - * - *

- * Definition: - * Subject being described by the file - *

- */ - public Subject getSubjectFirstRep() { - if (getSubject().isEmpty()) { - return addSubject(); - } - return getSubject().get(0); - } - - /** - * Gets the value(s) for sourceFile (Source GVF file). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * GVF file from which data of the resource is extracted - *

- */ - public AttachmentDt getSourceFile() { - if (mySourceFile == null) { - mySourceFile = new AttachmentDt(); - } - return mySourceFile; - } - - /** - * Sets the value(s) for sourceFile (Source GVF file) - * - *

- * Definition: - * GVF file from which data of the resource is extracted - *

- */ - public GVFMeta setSourceFile(AttachmentDt theValue) { - mySourceFile = theValue; - return this; - } - - - /** - * Gets the value(s) for gvfVersion (Version of the GVF file). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Valid version of the GVF file - *

- */ - public CodeDt getGvfVersion() { - if (myGvfVersion == null) { - myGvfVersion = new CodeDt(); - } - return myGvfVersion; - } - - /** - * Sets the value(s) for gvfVersion (Version of the GVF file) - * - *

- * Definition: - * Valid version of the GVF file - *

- */ - public GVFMeta setGvfVersion(CodeDt theValue) { - myGvfVersion = theValue; - return this; - } - - /** - * Sets the value for gvfVersion (Version of the GVF file) - * - *

- * Definition: - * Valid version of the GVF file - *

- */ - public GVFMeta setGvfVersion( String theCode) { - myGvfVersion = new CodeDt(theCode); - return this; - } - - - /** - * Gets the value(s) for referenceFasta (FASTA file used as reference assembly). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * URL to FASTA file used as reference assembly - *

- */ - public UriDt getReferenceFasta() { - if (myReferenceFasta == null) { - myReferenceFasta = new UriDt(); - } - return myReferenceFasta; - } - - /** - * Sets the value(s) for referenceFasta (FASTA file used as reference assembly) - * - *

- * Definition: - * URL to FASTA file used as reference assembly - *

- */ - public GVFMeta setReferenceFasta(UriDt theValue) { - myReferenceFasta = theValue; - return this; - } - - /** - * Sets the value for referenceFasta (FASTA file used as reference assembly) - * - *

- * Definition: - * URL to FASTA file used as reference assembly - *

- */ - public GVFMeta setReferenceFasta( String theUri) { - myReferenceFasta = new UriDt(theUri); - return this; - } - - - /** - * Gets the value(s) for featureGFF3 (GFF3 file containing feature being described in the file). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * GFF3 file containing feature being described in the file - *

- */ - public UriDt getFeatureGFF3() { - if (myFeatureGFF3 == null) { - myFeatureGFF3 = new UriDt(); - } - return myFeatureGFF3; - } - - /** - * Sets the value(s) for featureGFF3 (GFF3 file containing feature being described in the file) - * - *

- * Definition: - * GFF3 file containing feature being described in the file - *

- */ - public GVFMeta setFeatureGFF3(UriDt theValue) { - myFeatureGFF3 = theValue; - return this; - } - - /** - * Sets the value for featureGFF3 (GFF3 file containing feature being described in the file) - * - *

- * Definition: - * GFF3 file containing feature being described in the file - *

- */ - public GVFMeta setFeatureGFF3( String theUri) { - myFeatureGFF3 = new UriDt(theUri); - return this; - } - - - /** - * Gets the value(s) for fileDate (Date when the file is updated). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Date when the file is updated - *

- */ - public DateDt getFileDate() { - if (myFileDate == null) { - myFileDate = new DateDt(); - } - return myFileDate; - } - - /** - * Sets the value(s) for fileDate (Date when the file is updated) - * - *

- * Definition: - * Date when the file is updated - *

- */ - public GVFMeta setFileDate(DateDt theValue) { - myFileDate = theValue; - return this; - } - - /** - * Sets the value for fileDate (Date when the file is updated) - * - *

- * Definition: - * Date when the file is updated - *

- */ - public GVFMeta setFileDateWithDayPrecision( Date theDate) { - myFileDate = new DateDt(theDate); - return this; - } - - /** - * Sets the value for fileDate (Date when the file is updated) - * - *

- * Definition: - * Date when the file is updated - *

- */ - public GVFMeta setFileDate( Date theDate, TemporalPrecisionEnum thePrecision) { - myFileDate = new DateDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for individual (Id of individual being described in the file). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Id of individual being described in the file - *

- */ - public java.util.List getIndividual() { - if (myIndividual == null) { - myIndividual = new java.util.ArrayList(); - } - return myIndividual; - } - - /** - * Sets the value(s) for individual (Id of individual being described in the file) - * - *

- * Definition: - * Id of individual being described in the file - *

- */ - public GVFMeta setIndividual(java.util.List theValue) { - myIndividual = theValue; - return this; - } - - /** - * Adds and returns a new value for individual (Id of individual being described in the file) - * - *

- * Definition: - * Id of individual being described in the file - *

- */ - public StringDt addIndividual() { - StringDt newType = new StringDt(); - getIndividual().add(newType); - return newType; - } - - /** - * Gets the first repetition for individual (Id of individual being described in the file), - * creating it if it does not already exist. - * - *

- * Definition: - * Id of individual being described in the file - *

- */ - public StringDt getIndividualFirstRep() { - if (getIndividual().isEmpty()) { - return addIndividual(); - } - return getIndividual().get(0); - } - /** - * Adds a new value for individual (Id of individual being described in the file) - * - *

- * Definition: - * Id of individual being described in the file - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public GVFMeta addIndividual( String theString) { - if (myIndividual == null) { - myIndividual = new java.util.ArrayList(); - } - myIndividual.add(new StringDt(theString)); - return this; - } - - - /** - * Gets the value(s) for population (Code for population which the individual can be categorized into). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Code for population which the individual can be categorized into - *

- */ - public CodeDt getPopulation() { - if (myPopulation == null) { - myPopulation = new CodeDt(); - } - return myPopulation; - } - - /** - * Sets the value(s) for population (Code for population which the individual can be categorized into) - * - *

- * Definition: - * Code for population which the individual can be categorized into - *

- */ - public GVFMeta setPopulation(CodeDt theValue) { - myPopulation = theValue; - return this; - } - - /** - * Sets the value for population (Code for population which the individual can be categorized into) - * - *

- * Definition: - * Code for population which the individual can be categorized into - *

- */ - public GVFMeta setPopulation( String theCode) { - myPopulation = new CodeDt(theCode); - return this; - } - - - /** - * Gets the value(s) for platform (Sequencing platform). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Technology platform used in the sequencing - *

- */ - public Platform getPlatform() { - if (myPlatform == null) { - myPlatform = new Platform(); - } - return myPlatform; - } - - /** - * Sets the value(s) for platform (Sequencing platform) - * - *

- * Definition: - * Technology platform used in the sequencing - *

- */ - public GVFMeta setPlatform(Platform theValue) { - myPlatform = theValue; - return this; - } - - - /** - * Gets the value(s) for sequencingScope (Sequencing scope). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Scope of the sequencing - *

- */ - public CodeDt getSequencingScope() { - if (mySequencingScope == null) { - mySequencingScope = new CodeDt(); - } - return mySequencingScope; - } - - /** - * Sets the value(s) for sequencingScope (Sequencing scope) - * - *

- * Definition: - * Scope of the sequencing - *

- */ - public GVFMeta setSequencingScope(CodeDt theValue) { - mySequencingScope = theValue; - return this; - } - - /** - * Sets the value for sequencingScope (Sequencing scope) - * - *

- * Definition: - * Scope of the sequencing - *

- */ - public GVFMeta setSequencingScope( String theCode) { - mySequencingScope = new CodeDt(theCode); - return this; - } - - - /** - * Gets the value(s) for captureMethod (Capture method). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Capture method used in the sequencing - *

- */ - public CodeDt getCaptureMethod() { - if (myCaptureMethod == null) { - myCaptureMethod = new CodeDt(); - } - return myCaptureMethod; - } - - /** - * Sets the value(s) for captureMethod (Capture method) - * - *

- * Definition: - * Capture method used in the sequencing - *

- */ - public GVFMeta setCaptureMethod(CodeDt theValue) { - myCaptureMethod = theValue; - return this; - } - - /** - * Sets the value for captureMethod (Capture method) - * - *

- * Definition: - * Capture method used in the sequencing - *

- */ - public GVFMeta setCaptureMethod( String theCode) { - myCaptureMethod = new CodeDt(theCode); - return this; - } - - - /** - * Gets the value(s) for captureRegions (Region captured in the file). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Region captured in the file - *

- */ - public UriDt getCaptureRegions() { - if (myCaptureRegions == null) { - myCaptureRegions = new UriDt(); - } - return myCaptureRegions; - } - - /** - * Sets the value(s) for captureRegions (Region captured in the file) - * - *

- * Definition: - * Region captured in the file - *

- */ - public GVFMeta setCaptureRegions(UriDt theValue) { - myCaptureRegions = theValue; - return this; - } - - /** - * Sets the value for captureRegions (Region captured in the file) - * - *

- * Definition: - * Region captured in the file - *

- */ - public GVFMeta setCaptureRegions( String theUri) { - myCaptureRegions = new UriDt(theUri); - return this; - } - - - /** - * Gets the value(s) for sequenceAlignment (Sequence alignment algorithm/pipline used). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Sequence alignment algorithm/pipline used - *

- */ - public StringDt getSequenceAlignment() { - if (mySequenceAlignment == null) { - mySequenceAlignment = new StringDt(); - } - return mySequenceAlignment; - } - - /** - * Sets the value(s) for sequenceAlignment (Sequence alignment algorithm/pipline used) - * - *

- * Definition: - * Sequence alignment algorithm/pipline used - *

- */ - public GVFMeta setSequenceAlignment(StringDt theValue) { - mySequenceAlignment = theValue; - return this; - } - - /** - * Sets the value for sequenceAlignment (Sequence alignment algorithm/pipline used) - * - *

- * Definition: - * Sequence alignment algorithm/pipline used - *

- */ - public GVFMeta setSequenceAlignment( String theString) { - mySequenceAlignment = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for variantCalling (Pipline used for variant calling). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Pipline used for variant calling - *

- */ - public StringDt getVariantCalling() { - if (myVariantCalling == null) { - myVariantCalling = new StringDt(); - } - return myVariantCalling; - } - - /** - * Sets the value(s) for variantCalling (Pipline used for variant calling) - * - *

- * Definition: - * Pipline used for variant calling - *

- */ - public GVFMeta setVariantCalling(StringDt theValue) { - myVariantCalling = theValue; - return this; - } - - /** - * Sets the value for variantCalling (Pipline used for variant calling) - * - *

- * Definition: - * Pipline used for variant calling - *

- */ - public GVFMeta setVariantCalling( String theString) { - myVariantCalling = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for sampleDescription (Description of sample used in the sequencing). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Description of sample used in the sequencing - *

- */ - public StringDt getSampleDescription() { - if (mySampleDescription == null) { - mySampleDescription = new StringDt(); - } - return mySampleDescription; - } - - /** - * Sets the value(s) for sampleDescription (Description of sample used in the sequencing) - * - *

- * Definition: - * Description of sample used in the sequencing - *

- */ - public GVFMeta setSampleDescription(StringDt theValue) { - mySampleDescription = theValue; - return this; - } - - /** - * Sets the value for sampleDescription (Description of sample used in the sequencing) - * - *

- * Definition: - * Description of sample used in the sequencing - *

- */ - public GVFMeta setSampleDescription( String theString) { - mySampleDescription = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for genomicSource (Source of the sample). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Source of the sample - *

- */ - public CodeDt getGenomicSource() { - if (myGenomicSource == null) { - myGenomicSource = new CodeDt(); - } - return myGenomicSource; - } - - /** - * Sets the value(s) for genomicSource (Source of the sample) - * - *

- * Definition: - * Source of the sample - *

- */ - public GVFMeta setGenomicSource(CodeDt theValue) { - myGenomicSource = theValue; - return this; - } - - /** - * Sets the value for genomicSource (Source of the sample) - * - *

- * Definition: - * Source of the sample - *

- */ - public GVFMeta setGenomicSource( String theCode) { - myGenomicSource = new CodeDt(theCode); - return this; - } - - - /** - * Block class for child element: GVFMeta.subject (Subject being described by the file) - * - *

- * Definition: - * Subject being described by the file - *

- */ - @Block() - public static class Subject extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="patient", order=0, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="Identity of the subejct", - formalDefinition="Identity of the subejct" - ) - private ResourceReferenceDt myPatient; - - @Child(name="fieldId", type=StringDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Id of individual field of the file that correspond to the subject", - formalDefinition="Id of individual field of the file that correspond to the subject" - ) - private StringDt myFieldId; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myPatient, myFieldId); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myPatient, myFieldId); - } - - /** - * Gets the value(s) for patient (Identity of the subejct). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identity of the subejct - *

- */ - public ResourceReferenceDt getPatient() { - if (myPatient == null) { - myPatient = new ResourceReferenceDt(); - } - return myPatient; - } - - /** - * Sets the value(s) for patient (Identity of the subejct) - * - *

- * Definition: - * Identity of the subejct - *

- */ - public Subject setPatient(ResourceReferenceDt theValue) { - myPatient = theValue; - return this; - } - - - /** - * Gets the value(s) for fieldId (Id of individual field of the file that correspond to the subject). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Id of individual field of the file that correspond to the subject - *

- */ - public StringDt getFieldId() { - if (myFieldId == null) { - myFieldId = new StringDt(); - } - return myFieldId; - } - - /** - * Sets the value(s) for fieldId (Id of individual field of the file that correspond to the subject) - * - *

- * Definition: - * Id of individual field of the file that correspond to the subject - *

- */ - public Subject setFieldId(StringDt theValue) { - myFieldId = theValue; - return this; - } - - /** - * Sets the value for fieldId (Id of individual field of the file that correspond to the subject) - * - *

- * Definition: - * Id of individual field of the file that correspond to the subject - *

- */ - public Subject setFieldId( String theString) { - myFieldId = new StringDt(theString); - return this; - } - - - - } - - - /** - * Block class for child element: GVFMeta.platform (Sequencing platform) - * - *

- * Definition: - * Technology platform used in the sequencing - *

- */ - @Block() - public static class Platform extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="class", type=CodeDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Platform class", - formalDefinition="Class of the sequencing platform" - ) - private CodeDt myClassElement; - - @Child(name="version", type=StringDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Platform version", - formalDefinition="Version of the platform being used" - ) - private StringDt myVersion; - - @Child(name="name", type=CodeDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Platform name", - formalDefinition="Name of the platform being used" - ) - private CodeDt myName; - - @Child(name="identity", type=StringDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Platform id", - formalDefinition="Id of the platfrom being used" - ) - private StringDt myIdentity; - - @Child(name="readLength", type=IntegerDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="Read length", - formalDefinition="Read length of the technology" - ) - private IntegerDt myReadLength; - - @Child(name="readType", type=CodeDt.class, order=5, min=0, max=1) - @Description( - shortDefinition="Read type", - formalDefinition="Read type of the technology" - ) - private CodeDt myReadType; - - @Child(name="readPairSpan", type=IntegerDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="Read pair span", - formalDefinition="Read pair span of the technology" - ) - private IntegerDt myReadPairSpan; - - @Child(name="averageCoverage", type=IntegerDt.class, order=7, min=0, max=1) - @Description( - shortDefinition="Average coverage", - formalDefinition="Average coverage of the technology" - ) - private IntegerDt myAverageCoverage; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myClassElement, myVersion, myName, myIdentity, myReadLength, myReadType, myReadPairSpan, myAverageCoverage); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myClassElement, myVersion, myName, myIdentity, myReadLength, myReadType, myReadPairSpan, myAverageCoverage); - } - - /** - * Gets the value(s) for class (Platform class). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Class of the sequencing platform - *

- */ - public CodeDt getClassElement() { - if (myClassElement == null) { - myClassElement = new CodeDt(); - } - return myClassElement; - } - - /** - * Sets the value(s) for class (Platform class) - * - *

- * Definition: - * Class of the sequencing platform - *

- */ - public Platform setClassElement(CodeDt theValue) { - myClassElement = theValue; - return this; - } - - /** - * Sets the value for class (Platform class) - * - *

- * Definition: - * Class of the sequencing platform - *

- */ - public Platform setClassElement( String theCode) { - myClassElement = new CodeDt(theCode); - return this; - } - - - /** - * Gets the value(s) for version (Platform version). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Version of the platform being used - *

- */ - public StringDt getVersion() { - if (myVersion == null) { - myVersion = new StringDt(); - } - return myVersion; - } - - /** - * Sets the value(s) for version (Platform version) - * - *

- * Definition: - * Version of the platform being used - *

- */ - public Platform setVersion(StringDt theValue) { - myVersion = theValue; - return this; - } - - /** - * Sets the value for version (Platform version) - * - *

- * Definition: - * Version of the platform being used - *

- */ - public Platform setVersion( String theString) { - myVersion = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for name (Platform name). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Name of the platform being used - *

- */ - public CodeDt getName() { - if (myName == null) { - myName = new CodeDt(); - } - return myName; - } - - /** - * Sets the value(s) for name (Platform name) - * - *

- * Definition: - * Name of the platform being used - *

- */ - public Platform setName(CodeDt theValue) { - myName = theValue; - return this; - } - - /** - * Sets the value for name (Platform name) - * - *

- * Definition: - * Name of the platform being used - *

- */ - public Platform setName( String theCode) { - myName = new CodeDt(theCode); - return this; - } - - - /** - * Gets the value(s) for identity (Platform id). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Id of the platfrom being used - *

- */ - public StringDt getIdentity() { - if (myIdentity == null) { - myIdentity = new StringDt(); - } - return myIdentity; - } - - /** - * Sets the value(s) for identity (Platform id) - * - *

- * Definition: - * Id of the platfrom being used - *

- */ - public Platform setIdentity(StringDt theValue) { - myIdentity = theValue; - return this; - } - - /** - * Sets the value for identity (Platform id) - * - *

- * Definition: - * Id of the platfrom being used - *

- */ - public Platform setIdentity( String theString) { - myIdentity = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for readLength (Read length). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Read length of the technology - *

- */ - public IntegerDt getReadLength() { - if (myReadLength == null) { - myReadLength = new IntegerDt(); - } - return myReadLength; - } - - /** - * Sets the value(s) for readLength (Read length) - * - *

- * Definition: - * Read length of the technology - *

- */ - public Platform setReadLength(IntegerDt theValue) { - myReadLength = theValue; - return this; - } - - /** - * Sets the value for readLength (Read length) - * - *

- * Definition: - * Read length of the technology - *

- */ - public Platform setReadLength( int theInteger) { - myReadLength = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for readType (Read type). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Read type of the technology - *

- */ - public CodeDt getReadType() { - if (myReadType == null) { - myReadType = new CodeDt(); - } - return myReadType; - } - - /** - * Sets the value(s) for readType (Read type) - * - *

- * Definition: - * Read type of the technology - *

- */ - public Platform setReadType(CodeDt theValue) { - myReadType = theValue; - return this; - } - - /** - * Sets the value for readType (Read type) - * - *

- * Definition: - * Read type of the technology - *

- */ - public Platform setReadType( String theCode) { - myReadType = new CodeDt(theCode); - return this; - } - - - /** - * Gets the value(s) for readPairSpan (Read pair span). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Read pair span of the technology - *

- */ - public IntegerDt getReadPairSpan() { - if (myReadPairSpan == null) { - myReadPairSpan = new IntegerDt(); - } - return myReadPairSpan; - } - - /** - * Sets the value(s) for readPairSpan (Read pair span) - * - *

- * Definition: - * Read pair span of the technology - *

- */ - public Platform setReadPairSpan(IntegerDt theValue) { - myReadPairSpan = theValue; - return this; - } - - /** - * Sets the value for readPairSpan (Read pair span) - * - *

- * Definition: - * Read pair span of the technology - *

- */ - public Platform setReadPairSpan( int theInteger) { - myReadPairSpan = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for averageCoverage (Average coverage). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Average coverage of the technology - *

- */ - public IntegerDt getAverageCoverage() { - if (myAverageCoverage == null) { - myAverageCoverage = new IntegerDt(); - } - return myAverageCoverage; - } - - /** - * Sets the value(s) for averageCoverage (Average coverage) - * - *

- * Definition: - * Average coverage of the technology - *

- */ - public Platform setAverageCoverage(IntegerDt theValue) { - myAverageCoverage = theValue; - return this; - } - - /** - * Sets the value for averageCoverage (Average coverage) - * - *

- * Definition: - * Average coverage of the technology - *

- */ - public Platform setAverageCoverage( int theInteger) { - myAverageCoverage = new IntegerDt(theInteger); - return this; - } - - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GVFVariant.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GVFVariant.java deleted file mode 100644 index 5d90f43e474..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GVFVariant.java +++ /dev/null @@ -1,3199 +0,0 @@ - - - - - - - - - - - - - - - - -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.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.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.AttachmentDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.DecimalDt; -import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.StringClientParam; - - -/** - * HAPI/FHIR GVFVariant Resource - * (GVF Variant) - * - *

- * Definition: - * A segment of a GVF file - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/GVFVariant - *

- * - */ -@ResourceDef(name="GVFVariant", profile="http://hl7.org/fhir/profiles/GVFVariant", id="gvfvariant") -public class GVFVariant extends BaseResource implements IResource { - - /** - * Search parameter constant for patient - *

- * Description: Patient being described
- * Type: reference
- * Path: GVFVariant.subject.patient
- *

- */ - @SearchParamDefinition(name="patient", path="GVFVariant.subject.patient", description="Patient being described ", type="reference" ) - public static final String SP_PATIENT = "patient"; - - /** - * Fluent Client search parameter constant for patient - *

- * Description: Patient being described
- * Type: reference
- * Path: GVFVariant.subject.patient
- *

- */ - public static final ReferenceClientParam PATIENT = new ReferenceClientParam(SP_PATIENT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "GVFVariant.subject.patient". - */ - public static final Include INCLUDE_SUBJECT_PATIENT = new Include("GVFVariant.subject.patient"); - - /** - * Search parameter constant for coordinate - *

- * Description: Coordinate of the variant being studied
- * Type: string
- * Path:
- *

- */ - @SearchParamDefinition(name="coordinate", path="", description="Coordinate of the variant being studied", type="string" ) - public static final String SP_COORDINATE = "coordinate"; - - /** - * Fluent Client search parameter constant for coordinate - *

- * Description: Coordinate of the variant being studied
- * Type: string
- * Path:
- *

- */ - public static final StringClientParam COORDINATE = new StringClientParam(SP_COORDINATE); - - - @Child(name="subject", order=0, min=0, max=1) - @Description( - shortDefinition="Subject described by this segment of GVF file", - formalDefinition="Subject described by this segment of GVF file" - ) - private Subject mySubject; - - @Child(name="meta", order=1, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.GVFMeta.class }) - @Description( - shortDefinition="GVF Meta", - formalDefinition="Meta information of a GVF file" - ) - private ResourceReferenceDt myMeta; - - @Child(name="sourceFile", type=AttachmentDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Source file", - formalDefinition="Source GVF file" - ) - private AttachmentDt mySourceFile; - - @Child(name="seqid", type=StringDt.class, order=3, min=1, max=1) - @Description( - shortDefinition="Sequence Id", - formalDefinition="Id the sequence being described" - ) - private StringDt mySeqid; - - @Child(name="source", type=StringDt.class, order=4, min=1, max=1) - @Description( - shortDefinition="Data source", - formalDefinition="Algorithm or software used to generate the data" - ) - private StringDt mySource; - - @Child(name="type", type=CodeDt.class, order=5, min=1, max=1) - @Description( - shortDefinition="Feature type", - formalDefinition="Type of the feature being described" - ) - private CodeDt myType; - - @Child(name="start", type=IntegerDt.class, order=6, min=1, max=1) - @Description( - shortDefinition="Start position", - formalDefinition="Start position" - ) - private IntegerDt myStart; - - @Child(name="end", type=IntegerDt.class, order=7, min=1, max=1) - @Description( - shortDefinition="End position", - formalDefinition="End position" - ) - private IntegerDt myEnd; - - @Child(name="score", type=IntegerDt.class, order=8, min=1, max=1) - @Description( - shortDefinition="Sequence score", - formalDefinition="Phred scaled score of the sequence" - ) - private IntegerDt myScore; - - @Child(name="strand", type=CodeDt.class, order=9, min=1, max=1) - @Description( - shortDefinition="Strand", - formalDefinition="Direction of the strand" - ) - private CodeDt myStrand; - - @Child(name="featureId", type=StringDt.class, order=10, min=1, max=1) - @Description( - shortDefinition="Id of the feature", - formalDefinition="Id of the attribute, unique to other segments in the same source file" - ) - private StringDt myFeatureId; - - @Child(name="alias", type=StringDt.class, order=11, min=0, max=1) - @Description( - shortDefinition="Alias of the feature", - formalDefinition="Alias of the feature being described" - ) - private StringDt myAlias; - - @Child(name="dbxref", order=12, min=0, max=1) - @Description( - shortDefinition="Reference of the feature in a database", - formalDefinition="Reference of the feature in a database" - ) - private Dbxref myDbxref; - - @Child(name="variantSeq", type=StringDt.class, order=13, min=1, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Sequence presents in the variant", - formalDefinition="Sequence presents in the variant" - ) - private java.util.List myVariantSeq; - - @Child(name="referenceSeq", type=StringDt.class, order=14, min=0, max=1) - @Description( - shortDefinition="Reference sequence", - formalDefinition="Reference sequence" - ) - private StringDt myReferenceSeq; - - @Child(name="variantFreq", type=DecimalDt.class, order=15, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Variant frequency", - formalDefinition="Frequency of the variant" - ) - private java.util.List myVariantFreq; - - @Child(name="variantEffect", order=16, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Variant effect", - formalDefinition="Effect of the variant" - ) - private java.util.List myVariantEffect; - - @Child(name="startRange", order=17, min=0, max=1) - @Description( - shortDefinition="Start range", - formalDefinition="Attribute describing ambiguity of the start position of the feature" - ) - private StartRange myStartRange; - - @Child(name="endRange", order=18, min=0, max=1) - @Description( - shortDefinition="End range", - formalDefinition="Attribute describing ambiguity of the end position of the feature" - ) - private EndRange myEndRange; - - @Child(name="variantCodon", type=StringDt.class, order=19, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Codons that overlap with feature being described", - formalDefinition="Codons that overlap with the feature being described" - ) - private java.util.List myVariantCodon; - - @Child(name="referenceCodon", type=StringDt.class, order=20, min=0, max=1) - @Description( - shortDefinition="Codon that overlap with the reference sequence", - formalDefinition="Codon that overlap with the reference sequence" - ) - private StringDt myReferenceCodon; - - @Child(name="variantAA", type=StringDt.class, order=21, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Amino acids that overlap with the features being described", - formalDefinition="Amino acids that overlap with the features being described" - ) - private java.util.List myVariantAA; - - @Child(name="referenceAA", type=StringDt.class, order=22, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Amino acids that overlaps with the reference sequence", - formalDefinition="Amino acids that overlaps with the reference sequence" - ) - private java.util.List myReferenceAA; - - @Child(name="breakpointDetail", order=23, min=0, max=1) - @Description( - shortDefinition="Coordinate of a variant with zero length", - formalDefinition="Coordinate of a variant with zero length" - ) - private BreakpointDetail myBreakpointDetail; - - @Child(name="sequenceContext", order=24, min=0, max=1) - @Description( - shortDefinition="Context of features being described", - formalDefinition="Sequences adjacent to the feature" - ) - private SequenceContext mySequenceContext; - - @Child(name="individual", type=StringDt.class, order=25, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Individuals being described", - formalDefinition="Individuals for whom the feature is described" - ) - private java.util.List myIndividual; - - @Child(name="sample", order=26, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Individual genotypic information", - formalDefinition="Individual genotypic information" - ) - private java.util.List mySample; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySubject, myMeta, mySourceFile, mySeqid, mySource, myType, myStart, myEnd, myScore, myStrand, myFeatureId, myAlias, myDbxref, myVariantSeq, myReferenceSeq, myVariantFreq, myVariantEffect, myStartRange, myEndRange, myVariantCodon, myReferenceCodon, myVariantAA, myReferenceAA, myBreakpointDetail, mySequenceContext, myIndividual, mySample); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySubject, myMeta, mySourceFile, mySeqid, mySource, myType, myStart, myEnd, myScore, myStrand, myFeatureId, myAlias, myDbxref, myVariantSeq, myReferenceSeq, myVariantFreq, myVariantEffect, myStartRange, myEndRange, myVariantCodon, myReferenceCodon, myVariantAA, myReferenceAA, myBreakpointDetail, mySequenceContext, myIndividual, mySample); - } - - /** - * Gets the value(s) for subject (Subject described by this segment of GVF file). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Subject described by this segment of GVF file - *

- */ - public Subject getSubject() { - if (mySubject == null) { - mySubject = new Subject(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (Subject described by this segment of GVF file) - * - *

- * Definition: - * Subject described by this segment of GVF file - *

- */ - public GVFVariant setSubject(Subject theValue) { - mySubject = theValue; - return this; - } - - - /** - * Gets the value(s) for meta (GVF Meta). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Meta information of a GVF file - *

- */ - public ResourceReferenceDt getMeta() { - if (myMeta == null) { - myMeta = new ResourceReferenceDt(); - } - return myMeta; - } - - /** - * Sets the value(s) for meta (GVF Meta) - * - *

- * Definition: - * Meta information of a GVF file - *

- */ - public GVFVariant setMeta(ResourceReferenceDt theValue) { - myMeta = theValue; - return this; - } - - - /** - * Gets the value(s) for sourceFile (Source file). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Source GVF file - *

- */ - public AttachmentDt getSourceFile() { - if (mySourceFile == null) { - mySourceFile = new AttachmentDt(); - } - return mySourceFile; - } - - /** - * Sets the value(s) for sourceFile (Source file) - * - *

- * Definition: - * Source GVF file - *

- */ - public GVFVariant setSourceFile(AttachmentDt theValue) { - mySourceFile = theValue; - return this; - } - - - /** - * Gets the value(s) for seqid (Sequence Id). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Id the sequence being described - *

- */ - public StringDt getSeqid() { - if (mySeqid == null) { - mySeqid = new StringDt(); - } - return mySeqid; - } - - /** - * Sets the value(s) for seqid (Sequence Id) - * - *

- * Definition: - * Id the sequence being described - *

- */ - public GVFVariant setSeqid(StringDt theValue) { - mySeqid = theValue; - return this; - } - - /** - * Sets the value for seqid (Sequence Id) - * - *

- * Definition: - * Id the sequence being described - *

- */ - public GVFVariant setSeqid( String theString) { - mySeqid = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for source (Data source). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Algorithm or software used to generate the data - *

- */ - public StringDt getSource() { - if (mySource == null) { - mySource = new StringDt(); - } - return mySource; - } - - /** - * Sets the value(s) for source (Data source) - * - *

- * Definition: - * Algorithm or software used to generate the data - *

- */ - public GVFVariant setSource(StringDt theValue) { - mySource = theValue; - return this; - } - - /** - * Sets the value for source (Data source) - * - *

- * Definition: - * Algorithm or software used to generate the data - *

- */ - public GVFVariant setSource( String theString) { - mySource = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for type (Feature type). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Type of the feature being described - *

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

- * Definition: - * Type of the feature being described - *

- */ - public GVFVariant setType(CodeDt theValue) { - myType = theValue; - return this; - } - - /** - * Sets the value for type (Feature type) - * - *

- * Definition: - * Type of the feature being described - *

- */ - public GVFVariant setType( String theCode) { - myType = new CodeDt(theCode); - return this; - } - - - /** - * Gets the value(s) for start (Start position). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Start position - *

- */ - public IntegerDt getStart() { - if (myStart == null) { - myStart = new IntegerDt(); - } - return myStart; - } - - /** - * Sets the value(s) for start (Start position) - * - *

- * Definition: - * Start position - *

- */ - public GVFVariant setStart(IntegerDt theValue) { - myStart = theValue; - return this; - } - - /** - * Sets the value for start (Start position) - * - *

- * Definition: - * Start position - *

- */ - public GVFVariant setStart( int theInteger) { - myStart = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for end (End position). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * End position - *

- */ - public IntegerDt getEnd() { - if (myEnd == null) { - myEnd = new IntegerDt(); - } - return myEnd; - } - - /** - * Sets the value(s) for end (End position) - * - *

- * Definition: - * End position - *

- */ - public GVFVariant setEnd(IntegerDt theValue) { - myEnd = theValue; - return this; - } - - /** - * Sets the value for end (End position) - * - *

- * Definition: - * End position - *

- */ - public GVFVariant setEnd( int theInteger) { - myEnd = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for score (Sequence score). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Phred scaled score of the sequence - *

- */ - public IntegerDt getScore() { - if (myScore == null) { - myScore = new IntegerDt(); - } - return myScore; - } - - /** - * Sets the value(s) for score (Sequence score) - * - *

- * Definition: - * Phred scaled score of the sequence - *

- */ - public GVFVariant setScore(IntegerDt theValue) { - myScore = theValue; - return this; - } - - /** - * Sets the value for score (Sequence score) - * - *

- * Definition: - * Phred scaled score of the sequence - *

- */ - public GVFVariant setScore( int theInteger) { - myScore = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for strand (Strand). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Direction of the strand - *

- */ - public CodeDt getStrand() { - if (myStrand == null) { - myStrand = new CodeDt(); - } - return myStrand; - } - - /** - * Sets the value(s) for strand (Strand) - * - *

- * Definition: - * Direction of the strand - *

- */ - public GVFVariant setStrand(CodeDt theValue) { - myStrand = theValue; - return this; - } - - /** - * Sets the value for strand (Strand) - * - *

- * Definition: - * Direction of the strand - *

- */ - public GVFVariant setStrand( String theCode) { - myStrand = new CodeDt(theCode); - return this; - } - - - /** - * Gets the value(s) for featureId (Id of the feature). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Id of the attribute, unique to other segments in the same source file - *

- */ - public StringDt getFeatureId() { - if (myFeatureId == null) { - myFeatureId = new StringDt(); - } - return myFeatureId; - } - - /** - * Sets the value(s) for featureId (Id of the feature) - * - *

- * Definition: - * Id of the attribute, unique to other segments in the same source file - *

- */ - public GVFVariant setFeatureId(StringDt theValue) { - myFeatureId = theValue; - return this; - } - - /** - * Sets the value for featureId (Id of the feature) - * - *

- * Definition: - * Id of the attribute, unique to other segments in the same source file - *

- */ - public GVFVariant setFeatureId( String theString) { - myFeatureId = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for alias (Alias of the feature). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Alias of the feature being described - *

- */ - public StringDt getAlias() { - if (myAlias == null) { - myAlias = new StringDt(); - } - return myAlias; - } - - /** - * Sets the value(s) for alias (Alias of the feature) - * - *

- * Definition: - * Alias of the feature being described - *

- */ - public GVFVariant setAlias(StringDt theValue) { - myAlias = theValue; - return this; - } - - /** - * Sets the value for alias (Alias of the feature) - * - *

- * Definition: - * Alias of the feature being described - *

- */ - public GVFVariant setAlias( String theString) { - myAlias = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for dbxref (Reference of the feature in a database). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Reference of the feature in a database - *

- */ - public Dbxref getDbxref() { - if (myDbxref == null) { - myDbxref = new Dbxref(); - } - return myDbxref; - } - - /** - * Sets the value(s) for dbxref (Reference of the feature in a database) - * - *

- * Definition: - * Reference of the feature in a database - *

- */ - public GVFVariant setDbxref(Dbxref theValue) { - myDbxref = theValue; - return this; - } - - - /** - * Gets the value(s) for variantSeq (Sequence presents in the variant). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Sequence presents in the variant - *

- */ - public java.util.List getVariantSeq() { - if (myVariantSeq == null) { - myVariantSeq = new java.util.ArrayList(); - } - return myVariantSeq; - } - - /** - * Sets the value(s) for variantSeq (Sequence presents in the variant) - * - *

- * Definition: - * Sequence presents in the variant - *

- */ - public GVFVariant setVariantSeq(java.util.List theValue) { - myVariantSeq = theValue; - return this; - } - - /** - * Adds and returns a new value for variantSeq (Sequence presents in the variant) - * - *

- * Definition: - * Sequence presents in the variant - *

- */ - public StringDt addVariantSeq() { - StringDt newType = new StringDt(); - getVariantSeq().add(newType); - return newType; - } - - /** - * Gets the first repetition for variantSeq (Sequence presents in the variant), - * creating it if it does not already exist. - * - *

- * Definition: - * Sequence presents in the variant - *

- */ - public StringDt getVariantSeqFirstRep() { - if (getVariantSeq().isEmpty()) { - return addVariantSeq(); - } - return getVariantSeq().get(0); - } - /** - * Adds a new value for variantSeq (Sequence presents in the variant) - * - *

- * Definition: - * Sequence presents in the variant - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public GVFVariant addVariantSeq( String theString) { - if (myVariantSeq == null) { - myVariantSeq = new java.util.ArrayList(); - } - myVariantSeq.add(new StringDt(theString)); - return this; - } - - - /** - * Gets the value(s) for referenceSeq (Reference sequence). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Reference sequence - *

- */ - public StringDt getReferenceSeq() { - if (myReferenceSeq == null) { - myReferenceSeq = new StringDt(); - } - return myReferenceSeq; - } - - /** - * Sets the value(s) for referenceSeq (Reference sequence) - * - *

- * Definition: - * Reference sequence - *

- */ - public GVFVariant setReferenceSeq(StringDt theValue) { - myReferenceSeq = theValue; - return this; - } - - /** - * Sets the value for referenceSeq (Reference sequence) - * - *

- * Definition: - * Reference sequence - *

- */ - public GVFVariant setReferenceSeq( String theString) { - myReferenceSeq = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for variantFreq (Variant frequency). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Frequency of the variant - *

- */ - public java.util.List getVariantFreq() { - if (myVariantFreq == null) { - myVariantFreq = new java.util.ArrayList(); - } - return myVariantFreq; - } - - /** - * Sets the value(s) for variantFreq (Variant frequency) - * - *

- * Definition: - * Frequency of the variant - *

- */ - public GVFVariant setVariantFreq(java.util.List theValue) { - myVariantFreq = theValue; - return this; - } - - /** - * Adds and returns a new value for variantFreq (Variant frequency) - * - *

- * Definition: - * Frequency of the variant - *

- */ - public DecimalDt addVariantFreq() { - DecimalDt newType = new DecimalDt(); - getVariantFreq().add(newType); - return newType; - } - - /** - * Gets the first repetition for variantFreq (Variant frequency), - * creating it if it does not already exist. - * - *

- * Definition: - * Frequency of the variant - *

- */ - public DecimalDt getVariantFreqFirstRep() { - if (getVariantFreq().isEmpty()) { - return addVariantFreq(); - } - return getVariantFreq().get(0); - } - /** - * Adds a new value for variantFreq (Variant frequency) - * - *

- * Definition: - * Frequency of the variant - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public GVFVariant addVariantFreq( long theValue) { - if (myVariantFreq == null) { - myVariantFreq = new java.util.ArrayList(); - } - myVariantFreq.add(new DecimalDt(theValue)); - return this; - } - - /** - * Adds a new value for variantFreq (Variant frequency) - * - *

- * Definition: - * Frequency of the variant - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public GVFVariant addVariantFreq( double theValue) { - if (myVariantFreq == null) { - myVariantFreq = new java.util.ArrayList(); - } - myVariantFreq.add(new DecimalDt(theValue)); - return this; - } - - /** - * Adds a new value for variantFreq (Variant frequency) - * - *

- * Definition: - * Frequency of the variant - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public GVFVariant addVariantFreq( java.math.BigDecimal theValue) { - if (myVariantFreq == null) { - myVariantFreq = new java.util.ArrayList(); - } - myVariantFreq.add(new DecimalDt(theValue)); - return this; - } - - - /** - * Gets the value(s) for variantEffect (Variant effect). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Effect of the variant - *

- */ - public java.util.List getVariantEffect() { - if (myVariantEffect == null) { - myVariantEffect = new java.util.ArrayList(); - } - return myVariantEffect; - } - - /** - * Sets the value(s) for variantEffect (Variant effect) - * - *

- * Definition: - * Effect of the variant - *

- */ - public GVFVariant setVariantEffect(java.util.List theValue) { - myVariantEffect = theValue; - return this; - } - - /** - * Adds and returns a new value for variantEffect (Variant effect) - * - *

- * Definition: - * Effect of the variant - *

- */ - public VariantEffect addVariantEffect() { - VariantEffect newType = new VariantEffect(); - getVariantEffect().add(newType); - return newType; - } - - /** - * Gets the first repetition for variantEffect (Variant effect), - * creating it if it does not already exist. - * - *

- * Definition: - * Effect of the variant - *

- */ - public VariantEffect getVariantEffectFirstRep() { - if (getVariantEffect().isEmpty()) { - return addVariantEffect(); - } - return getVariantEffect().get(0); - } - - /** - * Gets the value(s) for startRange (Start range). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Attribute describing ambiguity of the start position of the feature - *

- */ - public StartRange getStartRange() { - if (myStartRange == null) { - myStartRange = new StartRange(); - } - return myStartRange; - } - - /** - * Sets the value(s) for startRange (Start range) - * - *

- * Definition: - * Attribute describing ambiguity of the start position of the feature - *

- */ - public GVFVariant setStartRange(StartRange theValue) { - myStartRange = theValue; - return this; - } - - - /** - * Gets the value(s) for endRange (End range). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Attribute describing ambiguity of the end position of the feature - *

- */ - public EndRange getEndRange() { - if (myEndRange == null) { - myEndRange = new EndRange(); - } - return myEndRange; - } - - /** - * Sets the value(s) for endRange (End range) - * - *

- * Definition: - * Attribute describing ambiguity of the end position of the feature - *

- */ - public GVFVariant setEndRange(EndRange theValue) { - myEndRange = theValue; - return this; - } - - - /** - * Gets the value(s) for variantCodon (Codons that overlap with feature being described). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Codons that overlap with the feature being described - *

- */ - public java.util.List getVariantCodon() { - if (myVariantCodon == null) { - myVariantCodon = new java.util.ArrayList(); - } - return myVariantCodon; - } - - /** - * Sets the value(s) for variantCodon (Codons that overlap with feature being described) - * - *

- * Definition: - * Codons that overlap with the feature being described - *

- */ - public GVFVariant setVariantCodon(java.util.List theValue) { - myVariantCodon = theValue; - return this; - } - - /** - * Adds and returns a new value for variantCodon (Codons that overlap with feature being described) - * - *

- * Definition: - * Codons that overlap with the feature being described - *

- */ - public StringDt addVariantCodon() { - StringDt newType = new StringDt(); - getVariantCodon().add(newType); - return newType; - } - - /** - * Gets the first repetition for variantCodon (Codons that overlap with feature being described), - * creating it if it does not already exist. - * - *

- * Definition: - * Codons that overlap with the feature being described - *

- */ - public StringDt getVariantCodonFirstRep() { - if (getVariantCodon().isEmpty()) { - return addVariantCodon(); - } - return getVariantCodon().get(0); - } - /** - * Adds a new value for variantCodon (Codons that overlap with feature being described) - * - *

- * Definition: - * Codons that overlap with the feature being described - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public GVFVariant addVariantCodon( String theString) { - if (myVariantCodon == null) { - myVariantCodon = new java.util.ArrayList(); - } - myVariantCodon.add(new StringDt(theString)); - return this; - } - - - /** - * Gets the value(s) for referenceCodon (Codon that overlap with the reference sequence). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Codon that overlap with the reference sequence - *

- */ - public StringDt getReferenceCodon() { - if (myReferenceCodon == null) { - myReferenceCodon = new StringDt(); - } - return myReferenceCodon; - } - - /** - * Sets the value(s) for referenceCodon (Codon that overlap with the reference sequence) - * - *

- * Definition: - * Codon that overlap with the reference sequence - *

- */ - public GVFVariant setReferenceCodon(StringDt theValue) { - myReferenceCodon = theValue; - return this; - } - - /** - * Sets the value for referenceCodon (Codon that overlap with the reference sequence) - * - *

- * Definition: - * Codon that overlap with the reference sequence - *

- */ - public GVFVariant setReferenceCodon( String theString) { - myReferenceCodon = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for variantAA (Amino acids that overlap with the features being described). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Amino acids that overlap with the features being described - *

- */ - public java.util.List getVariantAA() { - if (myVariantAA == null) { - myVariantAA = new java.util.ArrayList(); - } - return myVariantAA; - } - - /** - * Sets the value(s) for variantAA (Amino acids that overlap with the features being described) - * - *

- * Definition: - * Amino acids that overlap with the features being described - *

- */ - public GVFVariant setVariantAA(java.util.List theValue) { - myVariantAA = theValue; - return this; - } - - /** - * Adds and returns a new value for variantAA (Amino acids that overlap with the features being described) - * - *

- * Definition: - * Amino acids that overlap with the features being described - *

- */ - public StringDt addVariantAA() { - StringDt newType = new StringDt(); - getVariantAA().add(newType); - return newType; - } - - /** - * Gets the first repetition for variantAA (Amino acids that overlap with the features being described), - * creating it if it does not already exist. - * - *

- * Definition: - * Amino acids that overlap with the features being described - *

- */ - public StringDt getVariantAAFirstRep() { - if (getVariantAA().isEmpty()) { - return addVariantAA(); - } - return getVariantAA().get(0); - } - /** - * Adds a new value for variantAA (Amino acids that overlap with the features being described) - * - *

- * Definition: - * Amino acids that overlap with the features being described - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public GVFVariant addVariantAA( String theString) { - if (myVariantAA == null) { - myVariantAA = new java.util.ArrayList(); - } - myVariantAA.add(new StringDt(theString)); - return this; - } - - - /** - * Gets the value(s) for referenceAA (Amino acids that overlaps with the reference sequence). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Amino acids that overlaps with the reference sequence - *

- */ - public java.util.List getReferenceAA() { - if (myReferenceAA == null) { - myReferenceAA = new java.util.ArrayList(); - } - return myReferenceAA; - } - - /** - * Sets the value(s) for referenceAA (Amino acids that overlaps with the reference sequence) - * - *

- * Definition: - * Amino acids that overlaps with the reference sequence - *

- */ - public GVFVariant setReferenceAA(java.util.List theValue) { - myReferenceAA = theValue; - return this; - } - - /** - * Adds and returns a new value for referenceAA (Amino acids that overlaps with the reference sequence) - * - *

- * Definition: - * Amino acids that overlaps with the reference sequence - *

- */ - public StringDt addReferenceAA() { - StringDt newType = new StringDt(); - getReferenceAA().add(newType); - return newType; - } - - /** - * Gets the first repetition for referenceAA (Amino acids that overlaps with the reference sequence), - * creating it if it does not already exist. - * - *

- * Definition: - * Amino acids that overlaps with the reference sequence - *

- */ - public StringDt getReferenceAAFirstRep() { - if (getReferenceAA().isEmpty()) { - return addReferenceAA(); - } - return getReferenceAA().get(0); - } - /** - * Adds a new value for referenceAA (Amino acids that overlaps with the reference sequence) - * - *

- * Definition: - * Amino acids that overlaps with the reference sequence - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public GVFVariant addReferenceAA( String theString) { - if (myReferenceAA == null) { - myReferenceAA = new java.util.ArrayList(); - } - myReferenceAA.add(new StringDt(theString)); - return this; - } - - - /** - * Gets the value(s) for breakpointDetail (Coordinate of a variant with zero length). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Coordinate of a variant with zero length - *

- */ - public BreakpointDetail getBreakpointDetail() { - if (myBreakpointDetail == null) { - myBreakpointDetail = new BreakpointDetail(); - } - return myBreakpointDetail; - } - - /** - * Sets the value(s) for breakpointDetail (Coordinate of a variant with zero length) - * - *

- * Definition: - * Coordinate of a variant with zero length - *

- */ - public GVFVariant setBreakpointDetail(BreakpointDetail theValue) { - myBreakpointDetail = theValue; - return this; - } - - - /** - * Gets the value(s) for sequenceContext (Context of features being described). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Sequences adjacent to the feature - *

- */ - public SequenceContext getSequenceContext() { - if (mySequenceContext == null) { - mySequenceContext = new SequenceContext(); - } - return mySequenceContext; - } - - /** - * Sets the value(s) for sequenceContext (Context of features being described) - * - *

- * Definition: - * Sequences adjacent to the feature - *

- */ - public GVFVariant setSequenceContext(SequenceContext theValue) { - mySequenceContext = theValue; - return this; - } - - - /** - * Gets the value(s) for individual (Individuals being described). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Individuals for whom the feature is described - *

- */ - public java.util.List getIndividual() { - if (myIndividual == null) { - myIndividual = new java.util.ArrayList(); - } - return myIndividual; - } - - /** - * Sets the value(s) for individual (Individuals being described) - * - *

- * Definition: - * Individuals for whom the feature is described - *

- */ - public GVFVariant setIndividual(java.util.List theValue) { - myIndividual = theValue; - return this; - } - - /** - * Adds and returns a new value for individual (Individuals being described) - * - *

- * Definition: - * Individuals for whom the feature is described - *

- */ - public StringDt addIndividual() { - StringDt newType = new StringDt(); - getIndividual().add(newType); - return newType; - } - - /** - * Gets the first repetition for individual (Individuals being described), - * creating it if it does not already exist. - * - *

- * Definition: - * Individuals for whom the feature is described - *

- */ - public StringDt getIndividualFirstRep() { - if (getIndividual().isEmpty()) { - return addIndividual(); - } - return getIndividual().get(0); - } - /** - * Adds a new value for individual (Individuals being described) - * - *

- * Definition: - * Individuals for whom the feature is described - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public GVFVariant addIndividual( String theString) { - if (myIndividual == null) { - myIndividual = new java.util.ArrayList(); - } - myIndividual.add(new StringDt(theString)); - return this; - } - - - /** - * Gets the value(s) for sample (Individual genotypic information). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Individual genotypic information - *

- */ - public java.util.List getSample() { - if (mySample == null) { - mySample = new java.util.ArrayList(); - } - return mySample; - } - - /** - * Sets the value(s) for sample (Individual genotypic information) - * - *

- * Definition: - * Individual genotypic information - *

- */ - public GVFVariant setSample(java.util.List theValue) { - mySample = theValue; - return this; - } - - /** - * Adds and returns a new value for sample (Individual genotypic information) - * - *

- * Definition: - * Individual genotypic information - *

- */ - public Sample addSample() { - Sample newType = new Sample(); - getSample().add(newType); - return newType; - } - - /** - * Gets the first repetition for sample (Individual genotypic information), - * creating it if it does not already exist. - * - *

- * Definition: - * Individual genotypic information - *

- */ - public Sample getSampleFirstRep() { - if (getSample().isEmpty()) { - return addSample(); - } - return getSample().get(0); - } - - /** - * Block class for child element: GVFVariant.subject (Subject described by this segment of GVF file) - * - *

- * Definition: - * Subject described by this segment of GVF file - *

- */ - @Block() - public static class Subject extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="patient", order=0, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="Subject", - formalDefinition="Patient resource that stores information of the subejct" - ) - private ResourceReferenceDt myPatient; - - @Child(name="fileId", type=StringDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Individual Id", - formalDefinition="Id of individual in GVF file that corresponds to the subject (only mandatory if the file is a multi-individual one" - ) - private StringDt myFileId; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myPatient, myFileId); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myPatient, myFileId); - } - - /** - * Gets the value(s) for patient (Subject). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Patient resource that stores information of the subejct - *

- */ - public ResourceReferenceDt getPatient() { - if (myPatient == null) { - myPatient = new ResourceReferenceDt(); - } - return myPatient; - } - - /** - * Sets the value(s) for patient (Subject) - * - *

- * Definition: - * Patient resource that stores information of the subejct - *

- */ - public Subject setPatient(ResourceReferenceDt theValue) { - myPatient = theValue; - return this; - } - - - /** - * Gets the value(s) for fileId (Individual Id). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Id of individual in GVF file that corresponds to the subject (only mandatory if the file is a multi-individual one - *

- */ - public StringDt getFileId() { - if (myFileId == null) { - myFileId = new StringDt(); - } - return myFileId; - } - - /** - * Sets the value(s) for fileId (Individual Id) - * - *

- * Definition: - * Id of individual in GVF file that corresponds to the subject (only mandatory if the file is a multi-individual one - *

- */ - public Subject setFileId(StringDt theValue) { - myFileId = theValue; - return this; - } - - /** - * Sets the value for fileId (Individual Id) - * - *

- * Definition: - * Id of individual in GVF file that corresponds to the subject (only mandatory if the file is a multi-individual one - *

- */ - public Subject setFileId( String theString) { - myFileId = new StringDt(theString); - return this; - } - - - - } - - - /** - * Block class for child element: GVFVariant.dbxref (Reference of the feature in a database) - * - *

- * Definition: - * Reference of the feature in a database - *

- */ - @Block() - public static class Dbxref extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="database", type=CodeDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Name of the database", - formalDefinition="Name of the database" - ) - private CodeDt myDatabase; - - @Child(name="identity", type=StringDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="Id of the feature within the database", - formalDefinition="Id of the feature within the database" - ) - private StringDt myIdentity; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myDatabase, myIdentity); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myDatabase, myIdentity); - } - - /** - * Gets the value(s) for database (Name of the database). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Name of the database - *

- */ - public CodeDt getDatabase() { - if (myDatabase == null) { - myDatabase = new CodeDt(); - } - return myDatabase; - } - - /** - * Sets the value(s) for database (Name of the database) - * - *

- * Definition: - * Name of the database - *

- */ - public Dbxref setDatabase(CodeDt theValue) { - myDatabase = theValue; - return this; - } - - /** - * Sets the value for database (Name of the database) - * - *

- * Definition: - * Name of the database - *

- */ - public Dbxref setDatabase( String theCode) { - myDatabase = new CodeDt(theCode); - return this; - } - - - /** - * Gets the value(s) for identity (Id of the feature within the database). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Id of the feature within the database - *

- */ - public StringDt getIdentity() { - if (myIdentity == null) { - myIdentity = new StringDt(); - } - return myIdentity; - } - - /** - * Sets the value(s) for identity (Id of the feature within the database) - * - *

- * Definition: - * Id of the feature within the database - *

- */ - public Dbxref setIdentity(StringDt theValue) { - myIdentity = theValue; - return this; - } - - /** - * Sets the value for identity (Id of the feature within the database) - * - *

- * Definition: - * Id of the feature within the database - *

- */ - public Dbxref setIdentity( String theString) { - myIdentity = new StringDt(theString); - return this; - } - - - - } - - - /** - * Block class for child element: GVFVariant.variantEffect (Variant effect) - * - *

- * Definition: - * Effect of the variant - *

- */ - @Block() - public static class VariantEffect extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="sequenceVariant", type=CodeDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Effect of the variant", - formalDefinition="Effect of the variant" - ) - private CodeDt mySequenceVariant; - - @Child(name="index", type=IntegerDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="Index of variant being discussed", - formalDefinition="Zero-based index that tells the variant being discussed" - ) - private IntegerDt myIndex; - - @Child(name="featureType", type=CodeDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="Feature type", - formalDefinition="Type of the feature being described" - ) - private CodeDt myFeatureType; - - @Child(name="featureId", type=StringDt.class, order=3, min=1, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Feature Id", - formalDefinition="Id of features being affected by the variant" - ) - private java.util.List myFeatureId; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySequenceVariant, myIndex, myFeatureType, myFeatureId); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySequenceVariant, myIndex, myFeatureType, myFeatureId); - } - - /** - * Gets the value(s) for sequenceVariant (Effect of the variant). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Effect of the variant - *

- */ - public CodeDt getSequenceVariant() { - if (mySequenceVariant == null) { - mySequenceVariant = new CodeDt(); - } - return mySequenceVariant; - } - - /** - * Sets the value(s) for sequenceVariant (Effect of the variant) - * - *

- * Definition: - * Effect of the variant - *

- */ - public VariantEffect setSequenceVariant(CodeDt theValue) { - mySequenceVariant = theValue; - return this; - } - - /** - * Sets the value for sequenceVariant (Effect of the variant) - * - *

- * Definition: - * Effect of the variant - *

- */ - public VariantEffect setSequenceVariant( String theCode) { - mySequenceVariant = new CodeDt(theCode); - return this; - } - - - /** - * Gets the value(s) for index (Index of variant being discussed). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Zero-based index that tells the variant being discussed - *

- */ - public IntegerDt getIndex() { - if (myIndex == null) { - myIndex = new IntegerDt(); - } - return myIndex; - } - - /** - * Sets the value(s) for index (Index of variant being discussed) - * - *

- * Definition: - * Zero-based index that tells the variant being discussed - *

- */ - public VariantEffect setIndex(IntegerDt theValue) { - myIndex = theValue; - return this; - } - - /** - * Sets the value for index (Index of variant being discussed) - * - *

- * Definition: - * Zero-based index that tells the variant being discussed - *

- */ - public VariantEffect setIndex( int theInteger) { - myIndex = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for featureType (Feature type). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Type of the feature being described - *

- */ - public CodeDt getFeatureType() { - if (myFeatureType == null) { - myFeatureType = new CodeDt(); - } - return myFeatureType; - } - - /** - * Sets the value(s) for featureType (Feature type) - * - *

- * Definition: - * Type of the feature being described - *

- */ - public VariantEffect setFeatureType(CodeDt theValue) { - myFeatureType = theValue; - return this; - } - - /** - * Sets the value for featureType (Feature type) - * - *

- * Definition: - * Type of the feature being described - *

- */ - public VariantEffect setFeatureType( String theCode) { - myFeatureType = new CodeDt(theCode); - return this; - } - - - /** - * Gets the value(s) for featureId (Feature Id). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Id of features being affected by the variant - *

- */ - public java.util.List getFeatureId() { - if (myFeatureId == null) { - myFeatureId = new java.util.ArrayList(); - } - return myFeatureId; - } - - /** - * Sets the value(s) for featureId (Feature Id) - * - *

- * Definition: - * Id of features being affected by the variant - *

- */ - public VariantEffect setFeatureId(java.util.List theValue) { - myFeatureId = theValue; - return this; - } - - /** - * Adds and returns a new value for featureId (Feature Id) - * - *

- * Definition: - * Id of features being affected by the variant - *

- */ - public StringDt addFeatureId() { - StringDt newType = new StringDt(); - getFeatureId().add(newType); - return newType; - } - - /** - * Gets the first repetition for featureId (Feature Id), - * creating it if it does not already exist. - * - *

- * Definition: - * Id of features being affected by the variant - *

- */ - public StringDt getFeatureIdFirstRep() { - if (getFeatureId().isEmpty()) { - return addFeatureId(); - } - return getFeatureId().get(0); - } - /** - * Adds a new value for featureId (Feature Id) - * - *

- * Definition: - * Id of features being affected by the variant - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public VariantEffect addFeatureId( String theString) { - if (myFeatureId == null) { - myFeatureId = new java.util.ArrayList(); - } - myFeatureId.add(new StringDt(theString)); - return this; - } - - - - } - - - /** - * Block class for child element: GVFVariant.startRange (Start range) - * - *

- * Definition: - * Attribute describing ambiguity of the start position of the feature - *

- */ - @Block() - public static class StartRange extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="start", type=IntegerDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Start of the start range", - formalDefinition="Start of the start range" - ) - private IntegerDt myStart; - - @Child(name="end", type=IntegerDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="End of the start range", - formalDefinition="End of the start range" - ) - private IntegerDt 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 (Start of the start range). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Start of the start range - *

- */ - public IntegerDt getStart() { - if (myStart == null) { - myStart = new IntegerDt(); - } - return myStart; - } - - /** - * Sets the value(s) for start (Start of the start range) - * - *

- * Definition: - * Start of the start range - *

- */ - public StartRange setStart(IntegerDt theValue) { - myStart = theValue; - return this; - } - - /** - * Sets the value for start (Start of the start range) - * - *

- * Definition: - * Start of the start range - *

- */ - public StartRange setStart( int theInteger) { - myStart = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for end (End of the start range). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * End of the start range - *

- */ - public IntegerDt getEnd() { - if (myEnd == null) { - myEnd = new IntegerDt(); - } - return myEnd; - } - - /** - * Sets the value(s) for end (End of the start range) - * - *

- * Definition: - * End of the start range - *

- */ - public StartRange setEnd(IntegerDt theValue) { - myEnd = theValue; - return this; - } - - /** - * Sets the value for end (End of the start range) - * - *

- * Definition: - * End of the start range - *

- */ - public StartRange setEnd( int theInteger) { - myEnd = new IntegerDt(theInteger); - return this; - } - - - - } - - - /** - * Block class for child element: GVFVariant.endRange (End range) - * - *

- * Definition: - * Attribute describing ambiguity of the end position of the feature - *

- */ - @Block() - public static class EndRange extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="start", type=IntegerDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Start of the end range", - formalDefinition="Start of the end range" - ) - private IntegerDt myStart; - - @Child(name="end", type=IntegerDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="End of the end range", - formalDefinition="End of the end range" - ) - private IntegerDt 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 (Start of the end range). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Start of the end range - *

- */ - public IntegerDt getStart() { - if (myStart == null) { - myStart = new IntegerDt(); - } - return myStart; - } - - /** - * Sets the value(s) for start (Start of the end range) - * - *

- * Definition: - * Start of the end range - *

- */ - public EndRange setStart(IntegerDt theValue) { - myStart = theValue; - return this; - } - - /** - * Sets the value for start (Start of the end range) - * - *

- * Definition: - * Start of the end range - *

- */ - public EndRange setStart( int theInteger) { - myStart = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for end (End of the end range). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * End of the end range - *

- */ - public IntegerDt getEnd() { - if (myEnd == null) { - myEnd = new IntegerDt(); - } - return myEnd; - } - - /** - * Sets the value(s) for end (End of the end range) - * - *

- * Definition: - * End of the end range - *

- */ - public EndRange setEnd(IntegerDt theValue) { - myEnd = theValue; - return this; - } - - /** - * Sets the value for end (End of the end range) - * - *

- * Definition: - * End of the end range - *

- */ - public EndRange setEnd( int theInteger) { - myEnd = new IntegerDt(theInteger); - return this; - } - - - - } - - - /** - * Block class for child element: GVFVariant.breakpointDetail (Coordinate of a variant with zero length) - * - *

- * Definition: - * Coordinate of a variant with zero length - *

- */ - @Block() - public static class BreakpointDetail extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="seqid", type=StringDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Sequence Id of the variant", - formalDefinition="Sequence Id of the variant" - ) - private StringDt mySeqid; - - @Child(name="start", type=IntegerDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="Start position", - formalDefinition="Start position" - ) - private IntegerDt myStart; - - @Child(name="end", type=IntegerDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="End position", - formalDefinition="End position" - ) - private IntegerDt myEnd; - - @Child(name="strand", type=CodeDt.class, order=3, min=1, max=1) - @Description( - shortDefinition="Strand", - formalDefinition="Direction of strand" - ) - private CodeDt myStrand; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySeqid, myStart, myEnd, myStrand); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySeqid, myStart, myEnd, myStrand); - } - - /** - * Gets the value(s) for seqid (Sequence Id of the variant). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Sequence Id of the variant - *

- */ - public StringDt getSeqid() { - if (mySeqid == null) { - mySeqid = new StringDt(); - } - return mySeqid; - } - - /** - * Sets the value(s) for seqid (Sequence Id of the variant) - * - *

- * Definition: - * Sequence Id of the variant - *

- */ - public BreakpointDetail setSeqid(StringDt theValue) { - mySeqid = theValue; - return this; - } - - /** - * Sets the value for seqid (Sequence Id of the variant) - * - *

- * Definition: - * Sequence Id of the variant - *

- */ - public BreakpointDetail setSeqid( String theString) { - mySeqid = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for start (Start position). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Start position - *

- */ - public IntegerDt getStart() { - if (myStart == null) { - myStart = new IntegerDt(); - } - return myStart; - } - - /** - * Sets the value(s) for start (Start position) - * - *

- * Definition: - * Start position - *

- */ - public BreakpointDetail setStart(IntegerDt theValue) { - myStart = theValue; - return this; - } - - /** - * Sets the value for start (Start position) - * - *

- * Definition: - * Start position - *

- */ - public BreakpointDetail setStart( int theInteger) { - myStart = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for end (End position). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * End position - *

- */ - public IntegerDt getEnd() { - if (myEnd == null) { - myEnd = new IntegerDt(); - } - return myEnd; - } - - /** - * Sets the value(s) for end (End position) - * - *

- * Definition: - * End position - *

- */ - public BreakpointDetail setEnd(IntegerDt theValue) { - myEnd = theValue; - return this; - } - - /** - * Sets the value for end (End position) - * - *

- * Definition: - * End position - *

- */ - public BreakpointDetail setEnd( int theInteger) { - myEnd = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for strand (Strand). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Direction of strand - *

- */ - public CodeDt getStrand() { - if (myStrand == null) { - myStrand = new CodeDt(); - } - return myStrand; - } - - /** - * Sets the value(s) for strand (Strand) - * - *

- * Definition: - * Direction of strand - *

- */ - public BreakpointDetail setStrand(CodeDt theValue) { - myStrand = theValue; - return this; - } - - /** - * Sets the value for strand (Strand) - * - *

- * Definition: - * Direction of strand - *

- */ - public BreakpointDetail setStrand( String theCode) { - myStrand = new CodeDt(theCode); - return this; - } - - - - } - - - /** - * Block class for child element: GVFVariant.sequenceContext (Context of features being described) - * - *

- * Definition: - * Sequences adjacent to the feature - *

- */ - @Block() - public static class SequenceContext extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="fivePrime", type=StringDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="5 prime of the context", - formalDefinition="Sequence adjacent to the feature at its 5 prime" - ) - private StringDt myFivePrime; - - @Child(name="threePrime", type=StringDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="3 prime of the context", - formalDefinition="Sequence adjacent to the feature at its 3 prime" - ) - private StringDt myThreePrime; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myFivePrime, myThreePrime); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myFivePrime, myThreePrime); - } - - /** - * Gets the value(s) for fivePrime (5 prime of the context). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Sequence adjacent to the feature at its 5 prime - *

- */ - public StringDt getFivePrime() { - if (myFivePrime == null) { - myFivePrime = new StringDt(); - } - return myFivePrime; - } - - /** - * Sets the value(s) for fivePrime (5 prime of the context) - * - *

- * Definition: - * Sequence adjacent to the feature at its 5 prime - *

- */ - public SequenceContext setFivePrime(StringDt theValue) { - myFivePrime = theValue; - return this; - } - - /** - * Sets the value for fivePrime (5 prime of the context) - * - *

- * Definition: - * Sequence adjacent to the feature at its 5 prime - *

- */ - public SequenceContext setFivePrime( String theString) { - myFivePrime = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for threePrime (3 prime of the context). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Sequence adjacent to the feature at its 3 prime - *

- */ - public StringDt getThreePrime() { - if (myThreePrime == null) { - myThreePrime = new StringDt(); - } - return myThreePrime; - } - - /** - * Sets the value(s) for threePrime (3 prime of the context) - * - *

- * Definition: - * Sequence adjacent to the feature at its 3 prime - *

- */ - public SequenceContext setThreePrime(StringDt theValue) { - myThreePrime = theValue; - return this; - } - - /** - * Sets the value for threePrime (3 prime of the context) - * - *

- * Definition: - * Sequence adjacent to the feature at its 3 prime - *

- */ - public SequenceContext setThreePrime( String theString) { - myThreePrime = new StringDt(theString); - return this; - } - - - - } - - - /** - * Block class for child element: GVFVariant.sample (Individual genotypic information) - * - *

- * Definition: - * Individual genotypic information - *

- */ - @Block() - public static class Sample extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="phased", type=StringDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Phase status of the sequence", - formalDefinition="Attribute describing the phasing of a sequence" - ) - private java.util.List myPhased; - - @Child(name="genotype", type=StringDt.class, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Genotype of individuals", - formalDefinition="Genotypes of the individual" - ) - private java.util.List myGenotype; - - @Child(name="variantReads", type=IntegerDt.class, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Read number of the sequence", - formalDefinition="Renumber of the sequence" - ) - private java.util.List myVariantReads; - - @Child(name="totalReads", type=IntegerDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Total reads", - formalDefinition="Total reads of all sequence present in the sample" - ) - private IntegerDt myTotalReads; - - @Child(name="zygosity", type=CodeDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="Zygosity", - formalDefinition="Zygosity of the sequences" - ) - private CodeDt myZygosity; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myPhased, myGenotype, myVariantReads, myTotalReads, myZygosity); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myPhased, myGenotype, myVariantReads, myTotalReads, myZygosity); - } - - /** - * Gets the value(s) for phased (Phase status of the sequence). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Attribute describing the phasing of a sequence - *

- */ - public java.util.List getPhased() { - if (myPhased == null) { - myPhased = new java.util.ArrayList(); - } - return myPhased; - } - - /** - * Sets the value(s) for phased (Phase status of the sequence) - * - *

- * Definition: - * Attribute describing the phasing of a sequence - *

- */ - public Sample setPhased(java.util.List theValue) { - myPhased = theValue; - return this; - } - - /** - * Adds and returns a new value for phased (Phase status of the sequence) - * - *

- * Definition: - * Attribute describing the phasing of a sequence - *

- */ - public StringDt addPhased() { - StringDt newType = new StringDt(); - getPhased().add(newType); - return newType; - } - - /** - * Gets the first repetition for phased (Phase status of the sequence), - * creating it if it does not already exist. - * - *

- * Definition: - * Attribute describing the phasing of a sequence - *

- */ - public StringDt getPhasedFirstRep() { - if (getPhased().isEmpty()) { - return addPhased(); - } - return getPhased().get(0); - } - /** - * Adds a new value for phased (Phase status of the sequence) - * - *

- * Definition: - * Attribute describing the phasing of a sequence - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Sample addPhased( String theString) { - if (myPhased == null) { - myPhased = new java.util.ArrayList(); - } - myPhased.add(new StringDt(theString)); - return this; - } - - - /** - * Gets the value(s) for genotype (Genotype of individuals). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Genotypes of the individual - *

- */ - public java.util.List getGenotype() { - if (myGenotype == null) { - myGenotype = new java.util.ArrayList(); - } - return myGenotype; - } - - /** - * Sets the value(s) for genotype (Genotype of individuals) - * - *

- * Definition: - * Genotypes of the individual - *

- */ - public Sample setGenotype(java.util.List theValue) { - myGenotype = theValue; - return this; - } - - /** - * Adds and returns a new value for genotype (Genotype of individuals) - * - *

- * Definition: - * Genotypes of the individual - *

- */ - public StringDt addGenotype() { - StringDt newType = new StringDt(); - getGenotype().add(newType); - return newType; - } - - /** - * Gets the first repetition for genotype (Genotype of individuals), - * creating it if it does not already exist. - * - *

- * Definition: - * Genotypes of the individual - *

- */ - public StringDt getGenotypeFirstRep() { - if (getGenotype().isEmpty()) { - return addGenotype(); - } - return getGenotype().get(0); - } - /** - * Adds a new value for genotype (Genotype of individuals) - * - *

- * Definition: - * Genotypes of the individual - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Sample addGenotype( String theString) { - if (myGenotype == null) { - myGenotype = new java.util.ArrayList(); - } - myGenotype.add(new StringDt(theString)); - return this; - } - - - /** - * Gets the value(s) for variantReads (Read number of the sequence). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Renumber of the sequence - *

- */ - public java.util.List getVariantReads() { - if (myVariantReads == null) { - myVariantReads = new java.util.ArrayList(); - } - return myVariantReads; - } - - /** - * Sets the value(s) for variantReads (Read number of the sequence) - * - *

- * Definition: - * Renumber of the sequence - *

- */ - public Sample setVariantReads(java.util.List theValue) { - myVariantReads = theValue; - return this; - } - - /** - * Adds and returns a new value for variantReads (Read number of the sequence) - * - *

- * Definition: - * Renumber of the sequence - *

- */ - public IntegerDt addVariantReads() { - IntegerDt newType = new IntegerDt(); - getVariantReads().add(newType); - return newType; - } - - /** - * Gets the first repetition for variantReads (Read number of the sequence), - * creating it if it does not already exist. - * - *

- * Definition: - * Renumber of the sequence - *

- */ - public IntegerDt getVariantReadsFirstRep() { - if (getVariantReads().isEmpty()) { - return addVariantReads(); - } - return getVariantReads().get(0); - } - /** - * Adds a new value for variantReads (Read number of the sequence) - * - *

- * Definition: - * Renumber of the sequence - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Sample addVariantReads( int theInteger) { - if (myVariantReads == null) { - myVariantReads = new java.util.ArrayList(); - } - myVariantReads.add(new IntegerDt(theInteger)); - return this; - } - - - /** - * Gets the value(s) for totalReads (Total reads). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Total reads of all sequence present in the sample - *

- */ - public IntegerDt getTotalReads() { - if (myTotalReads == null) { - myTotalReads = new IntegerDt(); - } - return myTotalReads; - } - - /** - * Sets the value(s) for totalReads (Total reads) - * - *

- * Definition: - * Total reads of all sequence present in the sample - *

- */ - public Sample setTotalReads(IntegerDt theValue) { - myTotalReads = theValue; - return this; - } - - /** - * Sets the value for totalReads (Total reads) - * - *

- * Definition: - * Total reads of all sequence present in the sample - *

- */ - public Sample setTotalReads( int theInteger) { - myTotalReads = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for zygosity (Zygosity). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Zygosity of the sequences - *

- */ - public CodeDt getZygosity() { - if (myZygosity == null) { - myZygosity = new CodeDt(); - } - return myZygosity; - } - - /** - * Sets the value(s) for zygosity (Zygosity) - * - *

- * Definition: - * Zygosity of the sequences - *

- */ - public Sample setZygosity(CodeDt theValue) { - myZygosity = theValue; - return this; - } - - /** - * Sets the value for zygosity (Zygosity) - * - *

- * Definition: - * Zygosity of the sequences - *

- */ - public Sample setZygosity( String theCode) { - myZygosity = new CodeDt(theCode); - return this; - } - - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GeneExpression.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GeneExpression.java deleted file mode 100644 index b8f9a6055c1..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GeneExpression.java +++ /dev/null @@ -1,1059 +0,0 @@ - - - - - - - - - - - - - - - - -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.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.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.ResourceReferenceDt; -import ca.uhn.fhir.model.primitive.DecimalDt; -import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.StringClientParam; - - -/** - * HAPI/FHIR GeneExpression Resource - * (Resource that records the patient's expression of a gene) - * - *

- * Definition: - * Resource that records the patient's expression of a gene - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/GeneExpression - *

- * - */ -@ResourceDef(name="GeneExpression", profile="http://hl7.org/fhir/profiles/GeneExpression", id="geneexpression") -public class GeneExpression extends BaseResource implements IResource { - - /** - * Search parameter constant for subject - *

- * Description: subject being described by the resource
- * Type: reference
- * Path: GeneExpression.subject
- *

- */ - @SearchParamDefinition(name="subject", path="GeneExpression.subject", description="subject being described by the resource", type="reference" ) - public static final String SP_SUBJECT = "subject"; - - /** - * Fluent Client search parameter constant for subject - *

- * Description: subject being described by the resource
- * Type: reference
- * Path: GeneExpression.subject
- *

- */ - public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "GeneExpression.subject". - */ - public static final Include INCLUDE_SUBJECT = new Include("GeneExpression.subject"); - - /** - * Search parameter constant for gene - *

- * Description: Id of the gene
- * Type: string
- * Path: GeneExpression.gene.identifier
- *

- */ - @SearchParamDefinition(name="gene", path="GeneExpression.gene.identifier", description="Id of the gene", type="string" ) - public static final String SP_GENE = "gene"; - - /** - * Fluent Client search parameter constant for gene - *

- * Description: Id of the gene
- * Type: string
- * Path: GeneExpression.gene.identifier
- *

- */ - public static final StringClientParam GENE = new StringClientParam(SP_GENE); - - /** - * Search parameter constant for coordinate - *

- * Description: Coordinate of the gene
- * Type: string
- * Path: GeneExpression.gene.coordinate
- *

- */ - @SearchParamDefinition(name="coordinate", path="GeneExpression.gene.coordinate", description="Coordinate of the gene", type="string" ) - public static final String SP_COORDINATE = "coordinate"; - - /** - * Fluent Client search parameter constant for coordinate - *

- * Description: Coordinate of the gene
- * Type: string
- * Path: GeneExpression.gene.coordinate
- *

- */ - public static final StringClientParam COORDINATE = new StringClientParam(SP_COORDINATE); - - - @Child(name="subject", order=0, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="Subject described by the resource", - formalDefinition="Subject described by the resource" - ) - private ResourceReferenceDt mySubject; - - @Child(name="gene", order=1, min=1, max=1) - @Description( - shortDefinition="Gene of study", - formalDefinition="Gene of study" - ) - private Gene myGene; - - @Child(name="microarray", order=2, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Microarray.class }) - @Description( - shortDefinition="Microarray that studies the gene", - formalDefinition="Microarray that studies the gene" - ) - private java.util.List myMicroarray; - - @Child(name="rnaSeq", order=3, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="RNA-Seq that studies the gene", - formalDefinition="RNA-Seq that studies the gene" - ) - private java.util.List myRnaSeq; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySubject, myGene, myMicroarray, myRnaSeq); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySubject, myGene, myMicroarray, myRnaSeq); - } - - /** - * Gets the value(s) for subject (Subject described by the resource). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Subject described by the resource - *

- */ - public ResourceReferenceDt getSubject() { - if (mySubject == null) { - mySubject = new ResourceReferenceDt(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (Subject described by the resource) - * - *

- * Definition: - * Subject described by the resource - *

- */ - public GeneExpression setSubject(ResourceReferenceDt theValue) { - mySubject = theValue; - return this; - } - - - /** - * Gets the value(s) for gene (Gene of study). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Gene of study - *

- */ - public Gene getGene() { - if (myGene == null) { - myGene = new Gene(); - } - return myGene; - } - - /** - * Sets the value(s) for gene (Gene of study) - * - *

- * Definition: - * Gene of study - *

- */ - public GeneExpression setGene(Gene theValue) { - myGene = theValue; - return this; - } - - - /** - * Gets the value(s) for microarray (Microarray that studies the gene). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Microarray that studies the gene - *

- */ - public java.util.List getMicroarray() { - if (myMicroarray == null) { - myMicroarray = new java.util.ArrayList(); - } - return myMicroarray; - } - - /** - * Sets the value(s) for microarray (Microarray that studies the gene) - * - *

- * Definition: - * Microarray that studies the gene - *

- */ - public GeneExpression setMicroarray(java.util.List theValue) { - myMicroarray = theValue; - return this; - } - - /** - * Adds and returns a new value for microarray (Microarray that studies the gene) - * - *

- * Definition: - * Microarray that studies the gene - *

- */ - public ResourceReferenceDt addMicroarray() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getMicroarray().add(newType); - return newType; - } - - /** - * Gets the value(s) for rnaSeq (RNA-Seq that studies the gene). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * RNA-Seq that studies the gene - *

- */ - public java.util.List getRnaSeq() { - if (myRnaSeq == null) { - myRnaSeq = new java.util.ArrayList(); - } - return myRnaSeq; - } - - /** - * Sets the value(s) for rnaSeq (RNA-Seq that studies the gene) - * - *

- * Definition: - * RNA-Seq that studies the gene - *

- */ - public GeneExpression setRnaSeq(java.util.List theValue) { - myRnaSeq = theValue; - return this; - } - - /** - * Adds and returns a new value for rnaSeq (RNA-Seq that studies the gene) - * - *

- * Definition: - * RNA-Seq that studies the gene - *

- */ - public RnaSeq addRnaSeq() { - RnaSeq newType = new RnaSeq(); - getRnaSeq().add(newType); - return newType; - } - - /** - * Gets the first repetition for rnaSeq (RNA-Seq that studies the gene), - * creating it if it does not already exist. - * - *

- * Definition: - * RNA-Seq that studies the gene - *

- */ - public RnaSeq getRnaSeqFirstRep() { - if (getRnaSeq().isEmpty()) { - return addRnaSeq(); - } - return getRnaSeq().get(0); - } - - /** - * Block class for child element: GeneExpression.gene (Gene of study) - * - *

- * Definition: - * Gene of study - *

- */ - @Block() - public static class Gene extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="identifier", type=StringDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Identifier of the gene", - formalDefinition="Identifier of the gene" - ) - private StringDt myIdentifier; - - @Child(name="coordinate", order=1, min=0, max=1) - @Description( - shortDefinition="Coordinate of the gene", - formalDefinition="Coordinate of the gene" - ) - private GeneCoordinate myCoordinate; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myCoordinate); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myCoordinate); - } - - /** - * Gets the value(s) for identifier (Identifier of the gene). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifier of the gene - *

- */ - public StringDt getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new StringDt(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Identifier of the gene) - * - *

- * Definition: - * Identifier of the gene - *

- */ - public Gene setIdentifier(StringDt theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Sets the value for identifier (Identifier of the gene) - * - *

- * Definition: - * Identifier of the gene - *

- */ - public Gene setIdentifier( String theString) { - myIdentifier = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for coordinate (Coordinate of the gene). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Coordinate of the gene - *

- */ - public GeneCoordinate getCoordinate() { - if (myCoordinate == null) { - myCoordinate = new GeneCoordinate(); - } - return myCoordinate; - } - - /** - * Sets the value(s) for coordinate (Coordinate of the gene) - * - *

- * Definition: - * Coordinate of the gene - *

- */ - public Gene setCoordinate(GeneCoordinate theValue) { - myCoordinate = theValue; - return this; - } - - - - } - - /** - * Block class for child element: GeneExpression.gene.coordinate (Coordinate of the gene) - * - *

- * Definition: - * Coordinate of the gene - *

- */ - @Block() - public static class GeneCoordinate extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="chromosome", type=StringDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Chromosome", - formalDefinition="Chromosome" - ) - private StringDt myChromosome; - - @Child(name="start", type=IntegerDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="Start position", - formalDefinition="Start position" - ) - private IntegerDt myStart; - - @Child(name="end", type=IntegerDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="End position", - formalDefinition="End position" - ) - private IntegerDt myEnd; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myChromosome, myStart, myEnd); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myChromosome, myStart, myEnd); - } - - /** - * Gets the value(s) for chromosome (Chromosome). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Chromosome - *

- */ - public StringDt getChromosome() { - if (myChromosome == null) { - myChromosome = new StringDt(); - } - return myChromosome; - } - - /** - * Sets the value(s) for chromosome (Chromosome) - * - *

- * Definition: - * Chromosome - *

- */ - public GeneCoordinate setChromosome(StringDt theValue) { - myChromosome = theValue; - return this; - } - - /** - * Sets the value for chromosome (Chromosome) - * - *

- * Definition: - * Chromosome - *

- */ - public GeneCoordinate setChromosome( String theString) { - myChromosome = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for start (Start position). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Start position - *

- */ - public IntegerDt getStart() { - if (myStart == null) { - myStart = new IntegerDt(); - } - return myStart; - } - - /** - * Sets the value(s) for start (Start position) - * - *

- * Definition: - * Start position - *

- */ - public GeneCoordinate setStart(IntegerDt theValue) { - myStart = theValue; - return this; - } - - /** - * Sets the value for start (Start position) - * - *

- * Definition: - * Start position - *

- */ - public GeneCoordinate setStart( int theInteger) { - myStart = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for end (End position). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * End position - *

- */ - public IntegerDt getEnd() { - if (myEnd == null) { - myEnd = new IntegerDt(); - } - return myEnd; - } - - /** - * Sets the value(s) for end (End position) - * - *

- * Definition: - * End position - *

- */ - public GeneCoordinate setEnd(IntegerDt theValue) { - myEnd = theValue; - return this; - } - - /** - * Sets the value for end (End position) - * - *

- * Definition: - * End position - *

- */ - public GeneCoordinate setEnd( int theInteger) { - myEnd = new IntegerDt(theInteger); - return this; - } - - - - } - - - - /** - * Block class for child element: GeneExpression.rnaSeq (RNA-Seq that studies the gene) - * - *

- * Definition: - * RNA-Seq that studies the gene - *

- */ - @Block() - public static class RnaSeq extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="inputLab", order=0, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.SequencingLab.class }) - @Description( - shortDefinition="Input lab for the RNA-Seq", - formalDefinition="Input lab for the RNA-Seq" - ) - private ResourceReferenceDt myInputLab; - - @Child(name="inputAnalysis", order=1, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.SequencingAnalysis.class }) - @Description( - shortDefinition="Input analysis for the RNA-Seq", - formalDefinition="Input analysis for the RNA-Seq" - ) - private ResourceReferenceDt myInputAnalysis; - - @Child(name="expression", type=DecimalDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="Expression level of the gene in RPKM", - formalDefinition="Expression level of the gene in RPKM" - ) - private DecimalDt myExpression; - - @Child(name="isoform", order=3, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Isoform of the gene", - formalDefinition="Isoform of the gene" - ) - private java.util.List myIsoform; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myInputLab, myInputAnalysis, myExpression, myIsoform); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myInputLab, myInputAnalysis, myExpression, myIsoform); - } - - /** - * Gets the value(s) for inputLab (Input lab for the RNA-Seq). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Input lab for the RNA-Seq - *

- */ - public ResourceReferenceDt getInputLab() { - if (myInputLab == null) { - myInputLab = new ResourceReferenceDt(); - } - return myInputLab; - } - - /** - * Sets the value(s) for inputLab (Input lab for the RNA-Seq) - * - *

- * Definition: - * Input lab for the RNA-Seq - *

- */ - public RnaSeq setInputLab(ResourceReferenceDt theValue) { - myInputLab = theValue; - return this; - } - - - /** - * Gets the value(s) for inputAnalysis (Input analysis for the RNA-Seq). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Input analysis for the RNA-Seq - *

- */ - public ResourceReferenceDt getInputAnalysis() { - if (myInputAnalysis == null) { - myInputAnalysis = new ResourceReferenceDt(); - } - return myInputAnalysis; - } - - /** - * Sets the value(s) for inputAnalysis (Input analysis for the RNA-Seq) - * - *

- * Definition: - * Input analysis for the RNA-Seq - *

- */ - public RnaSeq setInputAnalysis(ResourceReferenceDt theValue) { - myInputAnalysis = theValue; - return this; - } - - - /** - * Gets the value(s) for expression (Expression level of the gene in RPKM). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Expression level of the gene in RPKM - *

- */ - public DecimalDt getExpression() { - if (myExpression == null) { - myExpression = new DecimalDt(); - } - return myExpression; - } - - /** - * Sets the value(s) for expression (Expression level of the gene in RPKM) - * - *

- * Definition: - * Expression level of the gene in RPKM - *

- */ - public RnaSeq setExpression(DecimalDt theValue) { - myExpression = theValue; - return this; - } - - /** - * Sets the value for expression (Expression level of the gene in RPKM) - * - *

- * Definition: - * Expression level of the gene in RPKM - *

- */ - public RnaSeq setExpression( long theValue) { - myExpression = new DecimalDt(theValue); - return this; - } - - /** - * Sets the value for expression (Expression level of the gene in RPKM) - * - *

- * Definition: - * Expression level of the gene in RPKM - *

- */ - public RnaSeq setExpression( double theValue) { - myExpression = new DecimalDt(theValue); - return this; - } - - /** - * Sets the value for expression (Expression level of the gene in RPKM) - * - *

- * Definition: - * Expression level of the gene in RPKM - *

- */ - public RnaSeq setExpression( java.math.BigDecimal theValue) { - myExpression = new DecimalDt(theValue); - return this; - } - - - /** - * Gets the value(s) for isoform (Isoform of the gene). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Isoform of the gene - *

- */ - public java.util.List getIsoform() { - if (myIsoform == null) { - myIsoform = new java.util.ArrayList(); - } - return myIsoform; - } - - /** - * Sets the value(s) for isoform (Isoform of the gene) - * - *

- * Definition: - * Isoform of the gene - *

- */ - public RnaSeq setIsoform(java.util.List theValue) { - myIsoform = theValue; - return this; - } - - /** - * Adds and returns a new value for isoform (Isoform of the gene) - * - *

- * Definition: - * Isoform of the gene - *

- */ - public RnaSeqIsoform addIsoform() { - RnaSeqIsoform newType = new RnaSeqIsoform(); - getIsoform().add(newType); - return newType; - } - - /** - * Gets the first repetition for isoform (Isoform of the gene), - * creating it if it does not already exist. - * - *

- * Definition: - * Isoform of the gene - *

- */ - public RnaSeqIsoform getIsoformFirstRep() { - if (getIsoform().isEmpty()) { - return addIsoform(); - } - return getIsoform().get(0); - } - - - } - - /** - * Block class for child element: GeneExpression.rnaSeq.isoform (Isoform of the gene) - * - *

- * Definition: - * Isoform of the gene - *

- */ - @Block() - public static class RnaSeqIsoform extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="identity", type=StringDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Identifier of the isoform", - formalDefinition="Identifier of the isoform" - ) - private StringDt myIdentity; - - @Child(name="expression", type=DecimalDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="Expression level of the isoform in RPKM", - formalDefinition="Expression level of the isoform in RPKM" - ) - private DecimalDt myExpression; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentity, myExpression); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentity, myExpression); - } - - /** - * Gets the value(s) for identity (Identifier of the isoform). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifier of the isoform - *

- */ - public StringDt getIdentity() { - if (myIdentity == null) { - myIdentity = new StringDt(); - } - return myIdentity; - } - - /** - * Sets the value(s) for identity (Identifier of the isoform) - * - *

- * Definition: - * Identifier of the isoform - *

- */ - public RnaSeqIsoform setIdentity(StringDt theValue) { - myIdentity = theValue; - return this; - } - - /** - * Sets the value for identity (Identifier of the isoform) - * - *

- * Definition: - * Identifier of the isoform - *

- */ - public RnaSeqIsoform setIdentity( String theString) { - myIdentity = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for expression (Expression level of the isoform in RPKM). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Expression level of the isoform in RPKM - *

- */ - public DecimalDt getExpression() { - if (myExpression == null) { - myExpression = new DecimalDt(); - } - return myExpression; - } - - /** - * Sets the value(s) for expression (Expression level of the isoform in RPKM) - * - *

- * Definition: - * Expression level of the isoform in RPKM - *

- */ - public RnaSeqIsoform setExpression(DecimalDt theValue) { - myExpression = theValue; - return this; - } - - /** - * Sets the value for expression (Expression level of the isoform in RPKM) - * - *

- * Definition: - * Expression level of the isoform in RPKM - *

- */ - public RnaSeqIsoform setExpression( long theValue) { - myExpression = new DecimalDt(theValue); - return this; - } - - /** - * Sets the value for expression (Expression level of the isoform in RPKM) - * - *

- * Definition: - * Expression level of the isoform in RPKM - *

- */ - public RnaSeqIsoform setExpression( double theValue) { - myExpression = new DecimalDt(theValue); - return this; - } - - /** - * Sets the value for expression (Expression level of the isoform in RPKM) - * - *

- * Definition: - * Expression level of the isoform in RPKM - *

- */ - public RnaSeqIsoform setExpression( java.math.BigDecimal theValue) { - myExpression = new DecimalDt(theValue); - return this; - } - - - - } - - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GeneticAnalysis.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GeneticAnalysis.java deleted file mode 100644 index 621fa7135b9..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GeneticAnalysis.java +++ /dev/null @@ -1,1426 +0,0 @@ - - - - - - - - - - - - - - - - -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.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.primitive.DateDt; -import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.rest.gclient.DateClientParam; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; - - -/** - * HAPI/FHIR GeneticAnalysis Resource - * (Analysis of a patient's genetic test) - * - *

- * Definition: - * Analysis of a patient's genetic test - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/GeneticAnalysis - *

- * - */ -@ResourceDef(name="GeneticAnalysis", profile="http://hl7.org/fhir/profiles/GeneticAnalysis", id="geneticanalysis") -public class GeneticAnalysis extends BaseResource implements IResource { - - /** - * Search parameter constant for subject - *

- * Description: Subject of the analysis
- * Type: reference
- * Path: GeneticAnalysis.subject
- *

- */ - @SearchParamDefinition(name="subject", path="GeneticAnalysis.subject", description="Subject of the analysis", type="reference" ) - public static final String SP_SUBJECT = "subject"; - - /** - * Fluent Client search parameter constant for subject - *

- * Description: Subject of the analysis
- * Type: reference
- * Path: GeneticAnalysis.subject
- *

- */ - public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "GeneticAnalysis.subject". - */ - public static final Include INCLUDE_SUBJECT = new Include("GeneticAnalysis.subject"); - - /** - * Search parameter constant for author - *

- * Description: Author of the analysis
- * Type: reference
- * Path: GeneticAnalysis.author
- *

- */ - @SearchParamDefinition(name="author", path="GeneticAnalysis.author", description="Author of the analysis", type="reference" ) - public static final String SP_AUTHOR = "author"; - - /** - * Fluent Client search parameter constant for author - *

- * Description: Author of the analysis
- * Type: reference
- * Path: GeneticAnalysis.author
- *

- */ - public static final ReferenceClientParam AUTHOR = new ReferenceClientParam(SP_AUTHOR); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "GeneticAnalysis.author". - */ - public static final Include INCLUDE_AUTHOR = new Include("GeneticAnalysis.author"); - - /** - * Search parameter constant for date - *

- * Description: Date when result of the analysis is uploaded
- * Type: date
- * Path: GeneticAnalysis.date
- *

- */ - @SearchParamDefinition(name="date", path="GeneticAnalysis.date", description="Date when result of the analysis is uploaded", type="date" ) - public static final String SP_DATE = "date"; - - /** - * Fluent Client search parameter constant for date - *

- * Description: Date when result of the analysis is uploaded
- * Type: date
- * Path: GeneticAnalysis.date
- *

- */ - public static final DateClientParam DATE = new DateClientParam(SP_DATE); - - - @Child(name="subject", order=0, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="Subject of the analysis", - formalDefinition="Subject of the analysis" - ) - private ResourceReferenceDt mySubject; - - @Child(name="author", order=1, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class }) - @Description( - shortDefinition="Author of the analysis", - formalDefinition="Author of the analysis" - ) - private ResourceReferenceDt myAuthor; - - @Child(name="date", type=DateDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Date when result of the analysis is updated", - formalDefinition="Date when result of the analysis is updated" - ) - private DateDt myDate; - - @Child(name="geneticAnalysisSummary", order=3, min=1, max=1) - @Description( - shortDefinition="Summary of the analysis", - formalDefinition="Summary of the analysis" - ) - private GeneticAnalysisSummary myGeneticAnalysisSummary; - - @Child(name="dnaRegionAnalysisTestCoverage", order=4, min=0, max=1) - @Description( - shortDefinition="Coverage of the genetic test", - formalDefinition="Coverage of the genetic test" - ) - private DnaRegionAnalysisTestCoverage myDnaRegionAnalysisTestCoverage; - - @Child(name="geneticAnalysisDiscreteResult", order=5, min=0, max=1) - @Description( - shortDefinition="Genetic analysis discrete result", - formalDefinition="Genetic analysis discrete result" - ) - private GeneticAnalysisDiscreteResult myGeneticAnalysisDiscreteResult; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySubject, myAuthor, myDate, myGeneticAnalysisSummary, myDnaRegionAnalysisTestCoverage, myGeneticAnalysisDiscreteResult); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySubject, myAuthor, myDate, myGeneticAnalysisSummary, myDnaRegionAnalysisTestCoverage, myGeneticAnalysisDiscreteResult); - } - - /** - * Gets the value(s) for subject (Subject of the analysis). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Subject of the analysis - *

- */ - public ResourceReferenceDt getSubject() { - if (mySubject == null) { - mySubject = new ResourceReferenceDt(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (Subject of the analysis) - * - *

- * Definition: - * Subject of the analysis - *

- */ - public GeneticAnalysis setSubject(ResourceReferenceDt theValue) { - mySubject = theValue; - return this; - } - - - /** - * Gets the value(s) for author (Author of the analysis). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Author of the analysis - *

- */ - public ResourceReferenceDt getAuthor() { - if (myAuthor == null) { - myAuthor = new ResourceReferenceDt(); - } - return myAuthor; - } - - /** - * Sets the value(s) for author (Author of the analysis) - * - *

- * Definition: - * Author of the analysis - *

- */ - public GeneticAnalysis setAuthor(ResourceReferenceDt theValue) { - myAuthor = theValue; - return this; - } - - - /** - * Gets the value(s) for date (Date when result of the analysis is updated). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Date when result of the analysis is updated - *

- */ - public DateDt getDate() { - if (myDate == null) { - myDate = new DateDt(); - } - return myDate; - } - - /** - * Sets the value(s) for date (Date when result of the analysis is updated) - * - *

- * Definition: - * Date when result of the analysis is updated - *

- */ - public GeneticAnalysis setDate(DateDt theValue) { - myDate = theValue; - return this; - } - - /** - * Sets the value for date (Date when result of the analysis is updated) - * - *

- * Definition: - * Date when result of the analysis is updated - *

- */ - public GeneticAnalysis setDateWithDayPrecision( Date theDate) { - myDate = new DateDt(theDate); - return this; - } - - /** - * Sets the value for date (Date when result of the analysis is updated) - * - *

- * Definition: - * Date when result of the analysis is updated - *

- */ - public GeneticAnalysis setDate( Date theDate, TemporalPrecisionEnum thePrecision) { - myDate = new DateDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for geneticAnalysisSummary (Summary of the analysis). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Summary of the analysis - *

- */ - public GeneticAnalysisSummary getGeneticAnalysisSummary() { - if (myGeneticAnalysisSummary == null) { - myGeneticAnalysisSummary = new GeneticAnalysisSummary(); - } - return myGeneticAnalysisSummary; - } - - /** - * Sets the value(s) for geneticAnalysisSummary (Summary of the analysis) - * - *

- * Definition: - * Summary of the analysis - *

- */ - public GeneticAnalysis setGeneticAnalysisSummary(GeneticAnalysisSummary theValue) { - myGeneticAnalysisSummary = theValue; - return this; - } - - - /** - * Gets the value(s) for dnaRegionAnalysisTestCoverage (Coverage of the genetic test). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Coverage of the genetic test - *

- */ - public DnaRegionAnalysisTestCoverage getDnaRegionAnalysisTestCoverage() { - if (myDnaRegionAnalysisTestCoverage == null) { - myDnaRegionAnalysisTestCoverage = new DnaRegionAnalysisTestCoverage(); - } - return myDnaRegionAnalysisTestCoverage; - } - - /** - * Sets the value(s) for dnaRegionAnalysisTestCoverage (Coverage of the genetic test) - * - *

- * Definition: - * Coverage of the genetic test - *

- */ - public GeneticAnalysis setDnaRegionAnalysisTestCoverage(DnaRegionAnalysisTestCoverage theValue) { - myDnaRegionAnalysisTestCoverage = theValue; - return this; - } - - - /** - * Gets the value(s) for geneticAnalysisDiscreteResult (Genetic analysis discrete result). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Genetic analysis discrete result - *

- */ - public GeneticAnalysisDiscreteResult getGeneticAnalysisDiscreteResult() { - if (myGeneticAnalysisDiscreteResult == null) { - myGeneticAnalysisDiscreteResult = new GeneticAnalysisDiscreteResult(); - } - return myGeneticAnalysisDiscreteResult; - } - - /** - * Sets the value(s) for geneticAnalysisDiscreteResult (Genetic analysis discrete result) - * - *

- * Definition: - * Genetic analysis discrete result - *

- */ - public GeneticAnalysis setGeneticAnalysisDiscreteResult(GeneticAnalysisDiscreteResult theValue) { - myGeneticAnalysisDiscreteResult = theValue; - return this; - } - - - /** - * Block class for child element: GeneticAnalysis.geneticAnalysisSummary (Summary of the analysis) - * - *

- * Definition: - * Summary of the analysis - *

- */ - @Block() - public static class GeneticAnalysisSummary extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="geneticDiseaseAssessed", type=CodingDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Genetic disease being assesed", - formalDefinition="Genetic disease being assesed" - ) - private CodingDt myGeneticDiseaseAssessed; - - @Child(name="medicationAssesed", type=CodingDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Medication being assesed", - formalDefinition="Medication being assesed" - ) - private CodingDt myMedicationAssesed; - - @Child(name="genomicSourceClass", type=CodingDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="Class of the source of sample", - formalDefinition="Class of the source of sample" - ) - private CodingDt myGenomicSourceClass; - - @Child(name="geneticDiseaseAnalysisOverallInterpretation", type=CodingDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Overall interpretation of the patient's genotype on the genetic disease being assesed", - formalDefinition="Overall interpretation of the patient's genotype on the genetic disease being assesed" - ) - private CodingDt myGeneticDiseaseAnalysisOverallInterpretation; - - @Child(name="geneticDiseaseAnalysisOverallCarrierInterpertation", type=CodingDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="Carrier status of the patietn", - formalDefinition="Carrier status of the patietn" - ) - private CodingDt myGeneticDiseaseAnalysisOverallCarrierInterpertation; - - @Child(name="drugEfficacyAnalysisOverallInterpretation", type=CodingDt.class, order=5, min=0, max=1) - @Description( - shortDefinition="Analysis on the efficacy of the drug being assessed", - formalDefinition="Analysis on the efficacy of the drug being assessed" - ) - private CodingDt myDrugEfficacyAnalysisOverallInterpretation; - - @Child(name="geneticAnalysisSummaryReport", type=StringDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="Summary of the analysis", - formalDefinition="Summary of the analysis" - ) - private StringDt myGeneticAnalysisSummaryReport; - - @Child(name="reasonForStudyAdditionalNote", type=StringDt.class, order=7, min=0, max=1) - @Description( - shortDefinition="Additional notes", - formalDefinition="Additional notes" - ) - private StringDt myReasonForStudyAdditionalNote; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myGeneticDiseaseAssessed, myMedicationAssesed, myGenomicSourceClass, myGeneticDiseaseAnalysisOverallInterpretation, myGeneticDiseaseAnalysisOverallCarrierInterpertation, myDrugEfficacyAnalysisOverallInterpretation, myGeneticAnalysisSummaryReport, myReasonForStudyAdditionalNote); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myGeneticDiseaseAssessed, myMedicationAssesed, myGenomicSourceClass, myGeneticDiseaseAnalysisOverallInterpretation, myGeneticDiseaseAnalysisOverallCarrierInterpertation, myDrugEfficacyAnalysisOverallInterpretation, myGeneticAnalysisSummaryReport, myReasonForStudyAdditionalNote); - } - - /** - * Gets the value(s) for geneticDiseaseAssessed (Genetic disease being assesed). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Genetic disease being assesed - *

- */ - public CodingDt getGeneticDiseaseAssessed() { - if (myGeneticDiseaseAssessed == null) { - myGeneticDiseaseAssessed = new CodingDt(); - } - return myGeneticDiseaseAssessed; - } - - /** - * Sets the value(s) for geneticDiseaseAssessed (Genetic disease being assesed) - * - *

- * Definition: - * Genetic disease being assesed - *

- */ - public GeneticAnalysisSummary setGeneticDiseaseAssessed(CodingDt theValue) { - myGeneticDiseaseAssessed = theValue; - return this; - } - - - /** - * Gets the value(s) for medicationAssesed (Medication being assesed). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Medication being assesed - *

- */ - public CodingDt getMedicationAssesed() { - if (myMedicationAssesed == null) { - myMedicationAssesed = new CodingDt(); - } - return myMedicationAssesed; - } - - /** - * Sets the value(s) for medicationAssesed (Medication being assesed) - * - *

- * Definition: - * Medication being assesed - *

- */ - public GeneticAnalysisSummary setMedicationAssesed(CodingDt theValue) { - myMedicationAssesed = theValue; - return this; - } - - - /** - * Gets the value(s) for genomicSourceClass (Class of the source of sample). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Class of the source of sample - *

- */ - public CodingDt getGenomicSourceClass() { - if (myGenomicSourceClass == null) { - myGenomicSourceClass = new CodingDt(); - } - return myGenomicSourceClass; - } - - /** - * Sets the value(s) for genomicSourceClass (Class of the source of sample) - * - *

- * Definition: - * Class of the source of sample - *

- */ - public GeneticAnalysisSummary setGenomicSourceClass(CodingDt theValue) { - myGenomicSourceClass = theValue; - return this; - } - - - /** - * Gets the value(s) for geneticDiseaseAnalysisOverallInterpretation (Overall interpretation of the patient's genotype on the genetic disease being assesed). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Overall interpretation of the patient's genotype on the genetic disease being assesed - *

- */ - public CodingDt getGeneticDiseaseAnalysisOverallInterpretation() { - if (myGeneticDiseaseAnalysisOverallInterpretation == null) { - myGeneticDiseaseAnalysisOverallInterpretation = new CodingDt(); - } - return myGeneticDiseaseAnalysisOverallInterpretation; - } - - /** - * Sets the value(s) for geneticDiseaseAnalysisOverallInterpretation (Overall interpretation of the patient's genotype on the genetic disease being assesed) - * - *

- * Definition: - * Overall interpretation of the patient's genotype on the genetic disease being assesed - *

- */ - public GeneticAnalysisSummary setGeneticDiseaseAnalysisOverallInterpretation(CodingDt theValue) { - myGeneticDiseaseAnalysisOverallInterpretation = theValue; - return this; - } - - - /** - * Gets the value(s) for geneticDiseaseAnalysisOverallCarrierInterpertation (Carrier status of the patietn). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Carrier status of the patietn - *

- */ - public CodingDt getGeneticDiseaseAnalysisOverallCarrierInterpertation() { - if (myGeneticDiseaseAnalysisOverallCarrierInterpertation == null) { - myGeneticDiseaseAnalysisOverallCarrierInterpertation = new CodingDt(); - } - return myGeneticDiseaseAnalysisOverallCarrierInterpertation; - } - - /** - * Sets the value(s) for geneticDiseaseAnalysisOverallCarrierInterpertation (Carrier status of the patietn) - * - *

- * Definition: - * Carrier status of the patietn - *

- */ - public GeneticAnalysisSummary setGeneticDiseaseAnalysisOverallCarrierInterpertation(CodingDt theValue) { - myGeneticDiseaseAnalysisOverallCarrierInterpertation = theValue; - return this; - } - - - /** - * Gets the value(s) for drugEfficacyAnalysisOverallInterpretation (Analysis on the efficacy of the drug being assessed). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Analysis on the efficacy of the drug being assessed - *

- */ - public CodingDt getDrugEfficacyAnalysisOverallInterpretation() { - if (myDrugEfficacyAnalysisOverallInterpretation == null) { - myDrugEfficacyAnalysisOverallInterpretation = new CodingDt(); - } - return myDrugEfficacyAnalysisOverallInterpretation; - } - - /** - * Sets the value(s) for drugEfficacyAnalysisOverallInterpretation (Analysis on the efficacy of the drug being assessed) - * - *

- * Definition: - * Analysis on the efficacy of the drug being assessed - *

- */ - public GeneticAnalysisSummary setDrugEfficacyAnalysisOverallInterpretation(CodingDt theValue) { - myDrugEfficacyAnalysisOverallInterpretation = theValue; - return this; - } - - - /** - * Gets the value(s) for geneticAnalysisSummaryReport (Summary of the analysis). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Summary of the analysis - *

- */ - public StringDt getGeneticAnalysisSummaryReport() { - if (myGeneticAnalysisSummaryReport == null) { - myGeneticAnalysisSummaryReport = new StringDt(); - } - return myGeneticAnalysisSummaryReport; - } - - /** - * Sets the value(s) for geneticAnalysisSummaryReport (Summary of the analysis) - * - *

- * Definition: - * Summary of the analysis - *

- */ - public GeneticAnalysisSummary setGeneticAnalysisSummaryReport(StringDt theValue) { - myGeneticAnalysisSummaryReport = theValue; - return this; - } - - /** - * Sets the value for geneticAnalysisSummaryReport (Summary of the analysis) - * - *

- * Definition: - * Summary of the analysis - *

- */ - public GeneticAnalysisSummary setGeneticAnalysisSummaryReport( String theString) { - myGeneticAnalysisSummaryReport = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for reasonForStudyAdditionalNote (Additional notes). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Additional notes - *

- */ - public StringDt getReasonForStudyAdditionalNote() { - if (myReasonForStudyAdditionalNote == null) { - myReasonForStudyAdditionalNote = new StringDt(); - } - return myReasonForStudyAdditionalNote; - } - - /** - * Sets the value(s) for reasonForStudyAdditionalNote (Additional notes) - * - *

- * Definition: - * Additional notes - *

- */ - public GeneticAnalysisSummary setReasonForStudyAdditionalNote(StringDt theValue) { - myReasonForStudyAdditionalNote = theValue; - return this; - } - - /** - * Sets the value for reasonForStudyAdditionalNote (Additional notes) - * - *

- * Definition: - * Additional notes - *

- */ - public GeneticAnalysisSummary setReasonForStudyAdditionalNote( String theString) { - myReasonForStudyAdditionalNote = new StringDt(theString); - return this; - } - - - - } - - - /** - * Block class for child element: GeneticAnalysis.dnaRegionAnalysisTestCoverage (Coverage of the genetic test) - * - *

- * Definition: - * Coverage of the genetic test - *

- */ - @Block() - public static class DnaRegionAnalysisTestCoverage extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="dnaRegionOfInterest", order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="DNA studied", - formalDefinition="DNA studied" - ) - private java.util.List myDnaRegionOfInterest; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myDnaRegionOfInterest); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myDnaRegionOfInterest); - } - - /** - * Gets the value(s) for dnaRegionOfInterest (DNA studied). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * DNA studied - *

- */ - public java.util.List getDnaRegionOfInterest() { - if (myDnaRegionOfInterest == null) { - myDnaRegionOfInterest = new java.util.ArrayList(); - } - return myDnaRegionOfInterest; - } - - /** - * Sets the value(s) for dnaRegionOfInterest (DNA studied) - * - *

- * Definition: - * DNA studied - *

- */ - public DnaRegionAnalysisTestCoverage setDnaRegionOfInterest(java.util.List theValue) { - myDnaRegionOfInterest = theValue; - return this; - } - - /** - * Adds and returns a new value for dnaRegionOfInterest (DNA studied) - * - *

- * Definition: - * DNA studied - *

- */ - public DnaRegionAnalysisTestCoverageDnaRegionOfInterest addDnaRegionOfInterest() { - DnaRegionAnalysisTestCoverageDnaRegionOfInterest newType = new DnaRegionAnalysisTestCoverageDnaRegionOfInterest(); - getDnaRegionOfInterest().add(newType); - return newType; - } - - /** - * Gets the first repetition for dnaRegionOfInterest (DNA studied), - * creating it if it does not already exist. - * - *

- * Definition: - * DNA studied - *

- */ - public DnaRegionAnalysisTestCoverageDnaRegionOfInterest getDnaRegionOfInterestFirstRep() { - if (getDnaRegionOfInterest().isEmpty()) { - return addDnaRegionOfInterest(); - } - return getDnaRegionOfInterest().get(0); - } - - - } - - /** - * Block class for child element: GeneticAnalysis.dnaRegionAnalysisTestCoverage.dnaRegionOfInterest (DNA studied) - * - *

- * Definition: - * DNA studied - *

- */ - @Block() - public static class DnaRegionAnalysisTestCoverageDnaRegionOfInterest extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="genomicReferenceSequenceIdentifier", type=StringDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Genomic reference sequence identifier", - formalDefinition="Identifier of the sequence represented in NCBI genomic nucleotide RefSeq IDs with their version number" - ) - private StringDt myGenomicReferenceSequenceIdentifier; - - @Child(name="regionOfInterestStart", type=IntegerDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Start position of the DNA region of interest", - formalDefinition="Start position of the DNA region of interest" - ) - private IntegerDt myRegionOfInterestStart; - - @Child(name="regionOfInterestStop", type=IntegerDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="End position of the DNA region of interest", - formalDefinition="End position of the DNA region of interest" - ) - private IntegerDt myRegionOfInterestStop; - - @Child(name="referenceNucleotide", type=StringDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Genotype of the region in reference genome", - formalDefinition="Genotype of the region in reference genome" - ) - private StringDt myReferenceNucleotide; - - @Child(name="variableNucleotide", type=StringDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="The patient's genotype in the region", - formalDefinition="The patient's genotype in the region" - ) - private StringDt myVariableNucleotide; - - @Child(name="genechipId", type=StringDt.class, order=5, min=0, max=1) - @Description( - shortDefinition="ID of the genechip", - formalDefinition="ID of the genechip" - ) - private StringDt myGenechipId; - - @Child(name="genechipManufacturerId", type=StringDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="ID of manufacturer of the genechip", - formalDefinition="ID of manufacturer of the genechip" - ) - private StringDt myGenechipManufacturerId; - - @Child(name="genechipVersion", type=StringDt.class, order=7, min=0, max=1) - @Description( - shortDefinition="Version of the genechip", - formalDefinition="Version of the genechip" - ) - private StringDt myGenechipVersion; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myGenomicReferenceSequenceIdentifier, myRegionOfInterestStart, myRegionOfInterestStop, myReferenceNucleotide, myVariableNucleotide, myGenechipId, myGenechipManufacturerId, myGenechipVersion); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myGenomicReferenceSequenceIdentifier, myRegionOfInterestStart, myRegionOfInterestStop, myReferenceNucleotide, myVariableNucleotide, myGenechipId, myGenechipManufacturerId, myGenechipVersion); - } - - /** - * Gets the value(s) for genomicReferenceSequenceIdentifier (Genomic reference sequence identifier). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifier of the sequence represented in NCBI genomic nucleotide RefSeq IDs with their version number - *

- */ - public StringDt getGenomicReferenceSequenceIdentifier() { - if (myGenomicReferenceSequenceIdentifier == null) { - myGenomicReferenceSequenceIdentifier = new StringDt(); - } - return myGenomicReferenceSequenceIdentifier; - } - - /** - * Sets the value(s) for genomicReferenceSequenceIdentifier (Genomic reference sequence identifier) - * - *

- * Definition: - * Identifier of the sequence represented in NCBI genomic nucleotide RefSeq IDs with their version number - *

- */ - public DnaRegionAnalysisTestCoverageDnaRegionOfInterest setGenomicReferenceSequenceIdentifier(StringDt theValue) { - myGenomicReferenceSequenceIdentifier = theValue; - return this; - } - - /** - * Sets the value for genomicReferenceSequenceIdentifier (Genomic reference sequence identifier) - * - *

- * Definition: - * Identifier of the sequence represented in NCBI genomic nucleotide RefSeq IDs with their version number - *

- */ - public DnaRegionAnalysisTestCoverageDnaRegionOfInterest setGenomicReferenceSequenceIdentifier( String theString) { - myGenomicReferenceSequenceIdentifier = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for regionOfInterestStart (Start position of the DNA region of interest). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Start position of the DNA region of interest - *

- */ - public IntegerDt getRegionOfInterestStart() { - if (myRegionOfInterestStart == null) { - myRegionOfInterestStart = new IntegerDt(); - } - return myRegionOfInterestStart; - } - - /** - * Sets the value(s) for regionOfInterestStart (Start position of the DNA region of interest) - * - *

- * Definition: - * Start position of the DNA region of interest - *

- */ - public DnaRegionAnalysisTestCoverageDnaRegionOfInterest setRegionOfInterestStart(IntegerDt theValue) { - myRegionOfInterestStart = theValue; - return this; - } - - /** - * Sets the value for regionOfInterestStart (Start position of the DNA region of interest) - * - *

- * Definition: - * Start position of the DNA region of interest - *

- */ - public DnaRegionAnalysisTestCoverageDnaRegionOfInterest setRegionOfInterestStart( int theInteger) { - myRegionOfInterestStart = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for regionOfInterestStop (End position of the DNA region of interest). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * End position of the DNA region of interest - *

- */ - public IntegerDt getRegionOfInterestStop() { - if (myRegionOfInterestStop == null) { - myRegionOfInterestStop = new IntegerDt(); - } - return myRegionOfInterestStop; - } - - /** - * Sets the value(s) for regionOfInterestStop (End position of the DNA region of interest) - * - *

- * Definition: - * End position of the DNA region of interest - *

- */ - public DnaRegionAnalysisTestCoverageDnaRegionOfInterest setRegionOfInterestStop(IntegerDt theValue) { - myRegionOfInterestStop = theValue; - return this; - } - - /** - * Sets the value for regionOfInterestStop (End position of the DNA region of interest) - * - *

- * Definition: - * End position of the DNA region of interest - *

- */ - public DnaRegionAnalysisTestCoverageDnaRegionOfInterest setRegionOfInterestStop( int theInteger) { - myRegionOfInterestStop = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for referenceNucleotide (Genotype of the region in reference genome). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Genotype of the region in reference genome - *

- */ - public StringDt getReferenceNucleotide() { - if (myReferenceNucleotide == null) { - myReferenceNucleotide = new StringDt(); - } - return myReferenceNucleotide; - } - - /** - * Sets the value(s) for referenceNucleotide (Genotype of the region in reference genome) - * - *

- * Definition: - * Genotype of the region in reference genome - *

- */ - public DnaRegionAnalysisTestCoverageDnaRegionOfInterest setReferenceNucleotide(StringDt theValue) { - myReferenceNucleotide = theValue; - return this; - } - - /** - * Sets the value for referenceNucleotide (Genotype of the region in reference genome) - * - *

- * Definition: - * Genotype of the region in reference genome - *

- */ - public DnaRegionAnalysisTestCoverageDnaRegionOfInterest setReferenceNucleotide( String theString) { - myReferenceNucleotide = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for variableNucleotide (The patient's genotype in the region). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The patient's genotype in the region - *

- */ - public StringDt getVariableNucleotide() { - if (myVariableNucleotide == null) { - myVariableNucleotide = new StringDt(); - } - return myVariableNucleotide; - } - - /** - * Sets the value(s) for variableNucleotide (The patient's genotype in the region) - * - *

- * Definition: - * The patient's genotype in the region - *

- */ - public DnaRegionAnalysisTestCoverageDnaRegionOfInterest setVariableNucleotide(StringDt theValue) { - myVariableNucleotide = theValue; - return this; - } - - /** - * Sets the value for variableNucleotide (The patient's genotype in the region) - * - *

- * Definition: - * The patient's genotype in the region - *

- */ - public DnaRegionAnalysisTestCoverageDnaRegionOfInterest setVariableNucleotide( String theString) { - myVariableNucleotide = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for genechipId (ID of the genechip). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * ID of the genechip - *

- */ - public StringDt getGenechipId() { - if (myGenechipId == null) { - myGenechipId = new StringDt(); - } - return myGenechipId; - } - - /** - * Sets the value(s) for genechipId (ID of the genechip) - * - *

- * Definition: - * ID of the genechip - *

- */ - public DnaRegionAnalysisTestCoverageDnaRegionOfInterest setGenechipId(StringDt theValue) { - myGenechipId = theValue; - return this; - } - - /** - * Sets the value for genechipId (ID of the genechip) - * - *

- * Definition: - * ID of the genechip - *

- */ - public DnaRegionAnalysisTestCoverageDnaRegionOfInterest setGenechipId( String theString) { - myGenechipId = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for genechipManufacturerId (ID of manufacturer of the genechip). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * ID of manufacturer of the genechip - *

- */ - public StringDt getGenechipManufacturerId() { - if (myGenechipManufacturerId == null) { - myGenechipManufacturerId = new StringDt(); - } - return myGenechipManufacturerId; - } - - /** - * Sets the value(s) for genechipManufacturerId (ID of manufacturer of the genechip) - * - *

- * Definition: - * ID of manufacturer of the genechip - *

- */ - public DnaRegionAnalysisTestCoverageDnaRegionOfInterest setGenechipManufacturerId(StringDt theValue) { - myGenechipManufacturerId = theValue; - return this; - } - - /** - * Sets the value for genechipManufacturerId (ID of manufacturer of the genechip) - * - *

- * Definition: - * ID of manufacturer of the genechip - *

- */ - public DnaRegionAnalysisTestCoverageDnaRegionOfInterest setGenechipManufacturerId( String theString) { - myGenechipManufacturerId = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for genechipVersion (Version of the genechip). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Version of the genechip - *

- */ - public StringDt getGenechipVersion() { - if (myGenechipVersion == null) { - myGenechipVersion = new StringDt(); - } - return myGenechipVersion; - } - - /** - * Sets the value(s) for genechipVersion (Version of the genechip) - * - *

- * Definition: - * Version of the genechip - *

- */ - public DnaRegionAnalysisTestCoverageDnaRegionOfInterest setGenechipVersion(StringDt theValue) { - myGenechipVersion = theValue; - return this; - } - - /** - * Sets the value for genechipVersion (Version of the genechip) - * - *

- * Definition: - * Version of the genechip - *

- */ - public DnaRegionAnalysisTestCoverageDnaRegionOfInterest setGenechipVersion( String theString) { - myGenechipVersion = new StringDt(theString); - return this; - } - - - - } - - - - /** - * Block class for child element: GeneticAnalysis.geneticAnalysisDiscreteResult (Genetic analysis discrete result) - * - *

- * Definition: - * Genetic analysis discrete result - *

- */ - @Block() - public static class GeneticAnalysisDiscreteResult extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="dnaAnalysisDiscreteSequenceVariation", type=StringDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="DNA analysis discrete sequence variation", - formalDefinition="DNA analysis discrete sequence variation" - ) - private java.util.List myDnaAnalysisDiscreteSequenceVariation; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myDnaAnalysisDiscreteSequenceVariation); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myDnaAnalysisDiscreteSequenceVariation); - } - - /** - * Gets the value(s) for dnaAnalysisDiscreteSequenceVariation (DNA analysis discrete sequence variation). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * DNA analysis discrete sequence variation - *

- */ - public java.util.List getDnaAnalysisDiscreteSequenceVariation() { - if (myDnaAnalysisDiscreteSequenceVariation == null) { - myDnaAnalysisDiscreteSequenceVariation = new java.util.ArrayList(); - } - return myDnaAnalysisDiscreteSequenceVariation; - } - - /** - * Sets the value(s) for dnaAnalysisDiscreteSequenceVariation (DNA analysis discrete sequence variation) - * - *

- * Definition: - * DNA analysis discrete sequence variation - *

- */ - public GeneticAnalysisDiscreteResult setDnaAnalysisDiscreteSequenceVariation(java.util.List theValue) { - myDnaAnalysisDiscreteSequenceVariation = theValue; - return this; - } - - /** - * Adds and returns a new value for dnaAnalysisDiscreteSequenceVariation (DNA analysis discrete sequence variation) - * - *

- * Definition: - * DNA analysis discrete sequence variation - *

- */ - public StringDt addDnaAnalysisDiscreteSequenceVariation() { - StringDt newType = new StringDt(); - getDnaAnalysisDiscreteSequenceVariation().add(newType); - return newType; - } - - /** - * Gets the first repetition for dnaAnalysisDiscreteSequenceVariation (DNA analysis discrete sequence variation), - * creating it if it does not already exist. - * - *

- * Definition: - * DNA analysis discrete sequence variation - *

- */ - public StringDt getDnaAnalysisDiscreteSequenceVariationFirstRep() { - if (getDnaAnalysisDiscreteSequenceVariation().isEmpty()) { - return addDnaAnalysisDiscreteSequenceVariation(); - } - return getDnaAnalysisDiscreteSequenceVariation().get(0); - } - /** - * Adds a new value for dnaAnalysisDiscreteSequenceVariation (DNA analysis discrete sequence variation) - * - *

- * Definition: - * DNA analysis discrete sequence variation - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public GeneticAnalysisDiscreteResult addDnaAnalysisDiscreteSequenceVariation( String theString) { - if (myDnaAnalysisDiscreteSequenceVariation == null) { - myDnaAnalysisDiscreteSequenceVariation = new java.util.ArrayList(); - } - myDnaAnalysisDiscreteSequenceVariation.add(new StringDt(theString)); - return this; - } - - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Group.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Group.java deleted file mode 100644 index 1d8e599d85d..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Group.java +++ /dev/null @@ -1,879 +0,0 @@ - - - - - - - - - - - - - - - - -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.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.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.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.RangeDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.GroupTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -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.IntegerDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.rest.gclient.CompositeClientParam; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR Group Resource - * (Group of multiple entities) - * - *

- * Definition: - * Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively and are not formally or legally recognized. I.e. A collection of entities that isn't an Organization - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Group - *

- * - */ -@ResourceDef(name="Group", profile="http://hl7.org/fhir/profiles/Group", id="group") -public class Group extends BaseResource implements IResource { - - /** - * Search parameter constant for type - *

- * Description: The type of resources the group contains
- * Type: token
- * Path: Group.type
- *

- */ - @SearchParamDefinition(name="type", path="Group.type", description="The type of resources the group contains", type="token" ) - public static final String SP_TYPE = "type"; - - /** - * Fluent Client search parameter constant for type - *

- * Description: The type of resources the group contains
- * Type: token
- * Path: Group.type
- *

- */ - public static final TokenClientParam TYPE = new TokenClientParam(SP_TYPE); - - /** - * Search parameter constant for code - *

- * Description: The kind of resources contained
- * Type: token
- * Path: Group.code
- *

- */ - @SearchParamDefinition(name="code", path="Group.code", description="The kind of resources contained", type="token" ) - public static final String SP_CODE = "code"; - - /** - * Fluent Client search parameter constant for code - *

- * Description: The kind of resources contained
- * Type: token
- * Path: Group.code
- *

- */ - public static final TokenClientParam CODE = new TokenClientParam(SP_CODE); - - /** - * Search parameter constant for actual - *

- * Description:
- * Type: token
- * Path: Group.actual
- *

- */ - @SearchParamDefinition(name="actual", path="Group.actual", description="", type="token" ) - public static final String SP_ACTUAL = "actual"; - - /** - * Fluent Client search parameter constant for actual - *

- * Description:
- * Type: token
- * Path: Group.actual
- *

- */ - public static final TokenClientParam ACTUAL = new TokenClientParam(SP_ACTUAL); - - /** - * Search parameter constant for identifier - *

- * Description:
- * Type: token
- * Path: Group.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Group.identifier", description="", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - - /** - * Fluent Client search parameter constant for identifier - *

- * Description:
- * Type: token
- * Path: Group.identifier
- *

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

- * Description:
- * Type: reference
- * Path: Group.member
- *

- */ - @SearchParamDefinition(name="member", path="Group.member", description="", type="reference" ) - public static final String SP_MEMBER = "member"; - - /** - * Fluent Client search parameter constant for member - *

- * Description:
- * Type: reference
- * Path: Group.member
- *

- */ - public static final ReferenceClientParam MEMBER = new ReferenceClientParam(SP_MEMBER); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Group.member". - */ - public static final Include INCLUDE_MEMBER = new Include("Group.member"); - - /** - * Search parameter constant for characteristic - *

- * Description:
- * Type: token
- * Path: Group.characteristic.code
- *

- */ - @SearchParamDefinition(name="characteristic", path="Group.characteristic.code", description="", type="token" ) - public static final String SP_CHARACTERISTIC = "characteristic"; - - /** - * Fluent Client search parameter constant for characteristic - *

- * Description:
- * Type: token
- * Path: Group.characteristic.code
- *

- */ - public static final TokenClientParam CHARACTERISTIC = new TokenClientParam(SP_CHARACTERISTIC); - - /** - * Search parameter constant for value - *

- * Description:
- * Type: token
- * Path: Group.characteristic.value[x]
- *

- */ - @SearchParamDefinition(name="value", path="Group.characteristic.value[x]", description="", type="token" ) - public static final String SP_VALUE = "value"; - - /** - * Fluent Client search parameter constant for value - *

- * Description:
- * Type: token
- * Path: Group.characteristic.value[x]
- *

- */ - public static final TokenClientParam VALUE = new TokenClientParam(SP_VALUE); - - /** - * Search parameter constant for exclude - *

- * Description:
- * Type: token
- * Path: Group.characteristic.exclude
- *

- */ - @SearchParamDefinition(name="exclude", path="Group.characteristic.exclude", description="", type="token" ) - public static final String SP_EXCLUDE = "exclude"; - - /** - * Fluent Client search parameter constant for exclude - *

- * Description:
- * Type: token
- * Path: Group.characteristic.exclude
- *

- */ - public static final TokenClientParam EXCLUDE = new TokenClientParam(SP_EXCLUDE); - - /** - * Search parameter constant for characteristic-value - *

- * Description: A composite of both characteristic and value
- * Type: composite
- * Path: characteristic & value
- *

- */ - @SearchParamDefinition(name="characteristic-value", path="characteristic & value", description="A composite of both characteristic and value", type="composite" , compositeOf={ "characteristic", "value" } ) - public static final String SP_CHARACTERISTIC_VALUE = "characteristic-value"; - - /** - * Fluent Client search parameter constant for characteristic-value - *

- * Description: A composite of both characteristic and value
- * Type: composite
- * Path: characteristic & value
- *

- */ - public static final CompositeClientParam CHARACTERISTIC_VALUE = new CompositeClientParam(SP_CHARACTERISTIC_VALUE); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Unique id", - formalDefinition="A unique business identifier for this group" - ) - private IdentifierDt myIdentifier; - - @Child(name="type", type=CodeDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="person | animal | practitioner | device | medication | substance", - formalDefinition="Identifies the broad classification of the kind of resources the group includes" - ) - private BoundCodeDt myType; - - @Child(name="actual", type=BooleanDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="Descriptive or actual", - formalDefinition="If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals" - ) - private BooleanDt myActual; - - @Child(name="code", type=CodeableConceptDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Kind of Group members", - formalDefinition="Provides a specific type of resource the group includes. E.g. \"cow\", \"syringe\", etc." - ) - private CodeableConceptDt myCode; - - @Child(name="name", type=StringDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="Label for Group", - formalDefinition="A label assigned to the group for human identification and communication" - ) - private StringDt myName; - - @Child(name="quantity", type=IntegerDt.class, order=5, min=0, max=1) - @Description( - shortDefinition="Number of members", - formalDefinition="A count of the number of resource instances that are part of the group" - ) - private IntegerDt myQuantity; - - @Child(name="characteristic", order=6, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Trait of group members", - formalDefinition="Identifies the traits shared by members of the group" - ) - private java.util.List myCharacteristic; - - @Child(name="member", order=7, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Device.class, ca.uhn.fhir.model.dstu.resource.Medication.class, ca.uhn.fhir.model.dstu.resource.Substance.class }) - @Description( - shortDefinition="Who is in group", - formalDefinition="Identifies the resource instances that are members of the group." - ) - private java.util.List myMember; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myType, myActual, myCode, myName, myQuantity, myCharacteristic, myMember); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myType, myActual, myCode, myName, myQuantity, myCharacteristic, myMember); - } - - /** - * Gets the value(s) for identifier (Unique id). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A unique business identifier for this group - *

- */ - public IdentifierDt getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new IdentifierDt(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Unique id) - * - *

- * Definition: - * A unique business identifier for this group - *

- */ - public Group setIdentifier(IdentifierDt theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Sets the value for identifier (Unique id) - * - *

- * Definition: - * A unique business identifier for this group - *

- */ - public Group setIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - myIdentifier = new IdentifierDt(theUse, theSystem, theValue, theLabel); - return this; - } - - /** - * Sets the value for identifier (Unique id) - * - *

- * Definition: - * A unique business identifier for this group - *

- */ - public Group setIdentifier( String theSystem, String theValue) { - myIdentifier = new IdentifierDt(theSystem, theValue); - return this; - } - - - /** - * Gets the value(s) for type (person | animal | practitioner | device | medication | substance). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the broad classification of the kind of resources the group includes - *

- */ - public BoundCodeDt getType() { - if (myType == null) { - myType = new BoundCodeDt(GroupTypeEnum.VALUESET_BINDER); - } - return myType; - } - - /** - * Sets the value(s) for type (person | animal | practitioner | device | medication | substance) - * - *

- * Definition: - * Identifies the broad classification of the kind of resources the group includes - *

- */ - public Group setType(BoundCodeDt theValue) { - myType = theValue; - return this; - } - - /** - * Sets the value(s) for type (person | animal | practitioner | device | medication | substance) - * - *

- * Definition: - * Identifies the broad classification of the kind of resources the group includes - *

- */ - public Group setType(GroupTypeEnum theValue) { - getType().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for actual (Descriptive or actual). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals - *

- */ - public BooleanDt getActual() { - if (myActual == null) { - myActual = new BooleanDt(); - } - return myActual; - } - - /** - * Sets the value(s) for actual (Descriptive or actual) - * - *

- * Definition: - * If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals - *

- */ - public Group setActual(BooleanDt theValue) { - myActual = theValue; - return this; - } - - /** - * Sets the value for actual (Descriptive or actual) - * - *

- * Definition: - * If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals - *

- */ - public Group setActual( boolean theBoolean) { - myActual = new BooleanDt(theBoolean); - return this; - } - - - /** - * Gets the value(s) for code (Kind of Group members). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Provides a specific type of resource the group includes. E.g. \"cow\", \"syringe\", etc. - *

- */ - public CodeableConceptDt getCode() { - if (myCode == null) { - myCode = new CodeableConceptDt(); - } - return myCode; - } - - /** - * Sets the value(s) for code (Kind of Group members) - * - *

- * Definition: - * Provides a specific type of resource the group includes. E.g. \"cow\", \"syringe\", etc. - *

- */ - public Group setCode(CodeableConceptDt theValue) { - myCode = theValue; - return this; - } - - - /** - * Gets the value(s) for name (Label for Group). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A label assigned to the group for human identification and communication - *

- */ - public StringDt getName() { - if (myName == null) { - myName = new StringDt(); - } - return myName; - } - - /** - * Sets the value(s) for name (Label for Group) - * - *

- * Definition: - * A label assigned to the group for human identification and communication - *

- */ - public Group setName(StringDt theValue) { - myName = theValue; - return this; - } - - /** - * Sets the value for name (Label for Group) - * - *

- * Definition: - * A label assigned to the group for human identification and communication - *

- */ - public Group setName( String theString) { - myName = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for quantity (Number of members). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A count of the number of resource instances that are part of the group - *

- */ - public IntegerDt getQuantity() { - if (myQuantity == null) { - myQuantity = new IntegerDt(); - } - return myQuantity; - } - - /** - * Sets the value(s) for quantity (Number of members) - * - *

- * Definition: - * A count of the number of resource instances that are part of the group - *

- */ - public Group setQuantity(IntegerDt theValue) { - myQuantity = theValue; - return this; - } - - /** - * Sets the value for quantity (Number of members) - * - *

- * Definition: - * A count of the number of resource instances that are part of the group - *

- */ - public Group setQuantity( int theInteger) { - myQuantity = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for characteristic (Trait of group members). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getCharacteristic() { - if (myCharacteristic == null) { - myCharacteristic = new java.util.ArrayList(); - } - return myCharacteristic; - } - - /** - * Sets the value(s) for characteristic (Trait of group members) - * - *

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

- */ - public Group setCharacteristic(java.util.List theValue) { - myCharacteristic = theValue; - return this; - } - - /** - * Adds and returns a new value for characteristic (Trait of group members) - * - *

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

- */ - public Characteristic addCharacteristic() { - Characteristic newType = new Characteristic(); - getCharacteristic().add(newType); - return newType; - } - - /** - * Gets the first repetition for characteristic (Trait of group members), - * creating it if it does not already exist. - * - *

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

- */ - public Characteristic getCharacteristicFirstRep() { - if (getCharacteristic().isEmpty()) { - return addCharacteristic(); - } - return getCharacteristic().get(0); - } - - /** - * Gets the value(s) for member (Who is in group). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getMember() { - if (myMember == null) { - myMember = new java.util.ArrayList(); - } - return myMember; - } - - /** - * Sets the value(s) for member (Who is in group) - * - *

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

- */ - public Group setMember(java.util.List theValue) { - myMember = theValue; - return this; - } - - /** - * Adds and returns a new value for member (Who is in group) - * - *

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

- */ - public ResourceReferenceDt addMember() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getMember().add(newType); - return newType; - } - - /** - * Block class for child element: Group.characteristic (Trait of group members) - * - *

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

- */ - @Block() - public static class Characteristic extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="code", type=CodeableConceptDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Kind of characteristic", - formalDefinition="A code that identifies the kind of trait being asserted" - ) - private CodeableConceptDt myCode; - - @Child(name="value", order=1, min=1, max=1, type={ - CodeableConceptDt.class, BooleanDt.class, QuantityDt.class, RangeDt.class }) - @Description( - shortDefinition="Value held by characteristic", - formalDefinition="The value of the trait that holds (or does not hold - see 'exclude') for members of the group" - ) - private IDatatype myValue; - - @Child(name="exclude", type=BooleanDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="Group includes or excludes", - formalDefinition="If true, indicates the characteristic is one that is NOT held by members of the group" - ) - private BooleanDt myExclude; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCode, myValue, myExclude); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCode, myValue, myExclude); - } - - /** - * Gets the value(s) for code (Kind of characteristic). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A code that identifies the kind of trait being asserted - *

- */ - public CodeableConceptDt getCode() { - if (myCode == null) { - myCode = new CodeableConceptDt(); - } - return myCode; - } - - /** - * Sets the value(s) for code (Kind of characteristic) - * - *

- * Definition: - * A code that identifies the kind of trait being asserted - *

- */ - public Characteristic setCode(CodeableConceptDt theValue) { - myCode = theValue; - return this; - } - - - /** - * Gets the value(s) for value[x] (Value held by characteristic). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The value of the trait that holds (or does not hold - see 'exclude') for members of the group - *

- */ - public IDatatype getValue() { - return myValue; - } - - /** - * Sets the value(s) for value[x] (Value held by characteristic) - * - *

- * Definition: - * The value of the trait that holds (or does not hold - see 'exclude') for members of the group - *

- */ - public Characteristic setValue(IDatatype theValue) { - myValue = theValue; - return this; - } - - - /** - * Gets the value(s) for exclude (Group includes or excludes). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * If true, indicates the characteristic is one that is NOT held by members of the group - *

- */ - public BooleanDt getExclude() { - if (myExclude == null) { - myExclude = new BooleanDt(); - } - return myExclude; - } - - /** - * Sets the value(s) for exclude (Group includes or excludes) - * - *

- * Definition: - * If true, indicates the characteristic is one that is NOT held by members of the group - *

- */ - public Characteristic setExclude(BooleanDt theValue) { - myExclude = theValue; - return this; - } - - /** - * Sets the value for exclude (Group includes or excludes) - * - *

- * Definition: - * If true, indicates the characteristic is one that is NOT held by members of the group - *

- */ - public Characteristic setExclude( boolean theBoolean) { - myExclude = new BooleanDt(theBoolean); - return this; - } - - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ImagingStudy.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ImagingStudy.java deleted file mode 100644 index 260a5f26c21..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ImagingStudy.java +++ /dev/null @@ -1,2189 +0,0 @@ - - - - - - - - - - - - - - - - -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.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.ImagingModalityEnum; -import ca.uhn.fhir.model.dstu.valueset.InstanceAvailabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.ModalityEnum; -import ca.uhn.fhir.model.primitive.BoundCodeDt; -import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.OidDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.primitive.UriDt; -import ca.uhn.fhir.rest.gclient.DateClientParam; -import ca.uhn.fhir.rest.gclient.NumberClientParam; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR ImagingStudy Resource - * (A set of images produced in single study (one or more series of references images)) - * - *

- * Definition: - * Manifest of a set of images produced in study. The set of images may include every image in the study, or it may be an incomplete sample, such as a list of key images - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/ImagingStudy - *

- * - */ -@ResourceDef(name="ImagingStudy", profile="http://hl7.org/fhir/profiles/ImagingStudy", id="imagingstudy") -public class ImagingStudy extends BaseResource implements IResource { - - /** - * Search parameter constant for subject - *

- * Description: Who the study is about
- * Type: reference
- * Path: ImagingStudy.subject
- *

- */ - @SearchParamDefinition(name="subject", path="ImagingStudy.subject", description="Who the study is about", type="reference" ) - public static final String SP_SUBJECT = "subject"; - - /** - * Fluent Client search parameter constant for subject - *

- * Description: Who the study is about
- * Type: reference
- * Path: ImagingStudy.subject
- *

- */ - public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ImagingStudy.subject". - */ - public static final Include INCLUDE_SUBJECT = new Include("ImagingStudy.subject"); - - /** - * Search parameter constant for date - *

- * Description: The date the study was done was taken
- * Type: date
- * Path: ImagingStudy.dateTime
- *

- */ - @SearchParamDefinition(name="date", path="ImagingStudy.dateTime", description="The date the study was done was taken", type="date" ) - public static final String SP_DATE = "date"; - - /** - * Fluent Client search parameter constant for date - *

- * Description: The date the study was done was taken
- * Type: date
- * Path: ImagingStudy.dateTime
- *

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

- * Description: The accession id for the image
- * Type: token
- * Path: ImagingStudy.accessionNo
- *

- */ - @SearchParamDefinition(name="accession", path="ImagingStudy.accessionNo", description="The accession id for the image", type="token" ) - public static final String SP_ACCESSION = "accession"; - - /** - * Fluent Client search parameter constant for accession - *

- * Description: The accession id for the image
- * Type: token
- * Path: ImagingStudy.accessionNo
- *

- */ - public static final TokenClientParam ACCESSION = new TokenClientParam(SP_ACCESSION); - - /** - * Search parameter constant for study - *

- * Description: The study id for the image
- * Type: token
- * Path: ImagingStudy.uid
- *

- */ - @SearchParamDefinition(name="study", path="ImagingStudy.uid", description="The study id for the image", type="token" ) - public static final String SP_STUDY = "study"; - - /** - * Fluent Client search parameter constant for study - *

- * Description: The study id for the image
- * Type: token
- * Path: ImagingStudy.uid
- *

- */ - public static final TokenClientParam STUDY = new TokenClientParam(SP_STUDY); - - /** - * Search parameter constant for series - *

- * Description: The series id for the image
- * Type: token
- * Path: ImagingStudy.series.uid
- *

- */ - @SearchParamDefinition(name="series", path="ImagingStudy.series.uid", description="The series id for the image", type="token" ) - public static final String SP_SERIES = "series"; - - /** - * Fluent Client search parameter constant for series - *

- * Description: The series id for the image
- * Type: token
- * Path: ImagingStudy.series.uid
- *

- */ - public static final TokenClientParam SERIES = new TokenClientParam(SP_SERIES); - - /** - * Search parameter constant for modality - *

- * Description: The modality of the image
- * Type: token
- * Path: ImagingStudy.series.modality
- *

- */ - @SearchParamDefinition(name="modality", path="ImagingStudy.series.modality", description="The modality of the image", type="token" ) - public static final String SP_MODALITY = "modality"; - - /** - * Fluent Client search parameter constant for modality - *

- * Description: The modality of the image
- * Type: token
- * Path: ImagingStudy.series.modality
- *

- */ - public static final TokenClientParam MODALITY = new TokenClientParam(SP_MODALITY); - - /** - * Search parameter constant for size - *

- * Description: The size of the image in MB - may include > or < in the value
- * Type: number
- * Path:
- *

- */ - @SearchParamDefinition(name="size", path="", description="The size of the image in MB - may include > or < in the value", type="number" ) - public static final String SP_SIZE = "size"; - - /** - * Fluent Client search parameter constant for size - *

- * Description: The size of the image in MB - may include > or < in the value
- * Type: number
- * Path:
- *

- */ - public static final NumberClientParam SIZE = new NumberClientParam(SP_SIZE); - - /** - * Search parameter constant for bodysite - *

- * Description:
- * Type: token
- * Path: ImagingStudy.series.bodySite
- *

- */ - @SearchParamDefinition(name="bodysite", path="ImagingStudy.series.bodySite", description="", type="token" ) - public static final String SP_BODYSITE = "bodysite"; - - /** - * Fluent Client search parameter constant for bodysite - *

- * Description:
- * Type: token
- * Path: ImagingStudy.series.bodySite
- *

- */ - public static final TokenClientParam BODYSITE = new TokenClientParam(SP_BODYSITE); - - /** - * Search parameter constant for uid - *

- * Description:
- * Type: token
- * Path: ImagingStudy.series.instance.uid
- *

- */ - @SearchParamDefinition(name="uid", path="ImagingStudy.series.instance.uid", description="", type="token" ) - public static final String SP_UID = "uid"; - - /** - * Fluent Client search parameter constant for uid - *

- * Description:
- * Type: token
- * Path: ImagingStudy.series.instance.uid
- *

- */ - public static final TokenClientParam UID = new TokenClientParam(SP_UID); - - /** - * Search parameter constant for dicom-class - *

- * Description:
- * Type: token
- * Path: ImagingStudy.series.instance.sopclass
- *

- */ - @SearchParamDefinition(name="dicom-class", path="ImagingStudy.series.instance.sopclass", description="", type="token" ) - public static final String SP_DICOM_CLASS = "dicom-class"; - - /** - * Fluent Client search parameter constant for dicom-class - *

- * Description:
- * Type: token
- * Path: ImagingStudy.series.instance.sopclass
- *

- */ - public static final TokenClientParam DICOM_CLASS = new TokenClientParam(SP_DICOM_CLASS); - - - @Child(name="dateTime", type=DateTimeDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="When the study was performed", - formalDefinition="Date and Time the study took place" - ) - private DateTimeDt myDateTime; - - @Child(name="subject", order=1, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="Who the images are of", - formalDefinition="Who the images are of" - ) - private ResourceReferenceDt mySubject; - - @Child(name="uid", type=OidDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="Formal identifier for the study (0020,000D)", - formalDefinition="Formal identifier for the study" - ) - private OidDt myUid; - - @Child(name="accessionNo", type=IdentifierDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Accession Number (0008,0050)", - formalDefinition="Accession Number" - ) - private IdentifierDt myAccessionNo; - - @Child(name="identifier", type=IdentifierDt.class, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Other identifiers for the study (0020,0010)", - formalDefinition="Other identifiers for the study" - ) - private java.util.List myIdentifier; - - @Child(name="order", order=5, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.DiagnosticOrder.class }) - @Description( - shortDefinition="Order(s) that caused this study to be performed", - formalDefinition="A list of the diagnostic orders that resulted in this imaging study being performed" - ) - private java.util.List myOrder; - - @Child(name="modality", type=CodeDt.class, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="All series.modality if actual acquisition modalities", - formalDefinition="A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19)" - ) - private java.util.List> myModality; - - @Child(name="referrer", order=7, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class }) - @Description( - shortDefinition="Referring physician (0008,0090)", - formalDefinition="The requesting/referring physician" - ) - private ResourceReferenceDt myReferrer; - - @Child(name="availability", type=CodeDt.class, order=8, min=0, max=1) - @Description( - shortDefinition="ONLINE | OFFLINE | NEARLINE | UNAVAILABLE (0008,0056)", - formalDefinition="Availability of study (online, offline or nearline)" - ) - private BoundCodeDt myAvailability; - - @Child(name="url", type=UriDt.class, order=9, min=0, max=1) - @Description( - shortDefinition="Retrieve URI (0008,1190)", - formalDefinition="WADO-RS URI where Study is available" - ) - private UriDt myUrl; - - @Child(name="numberOfSeries", type=IntegerDt.class, order=10, min=1, max=1) - @Description( - shortDefinition="Number of Study Related Series (0020,1206)", - formalDefinition="Number of Series in Study" - ) - private IntegerDt myNumberOfSeries; - - @Child(name="numberOfInstances", type=IntegerDt.class, order=11, min=1, max=1) - @Description( - shortDefinition="Number of Study Related Instances (0020,1208)", - formalDefinition="Number of SOP Instances in Study" - ) - private IntegerDt myNumberOfInstances; - - @Child(name="clinicalInformation", type=StringDt.class, order=12, min=0, max=1) - @Description( - shortDefinition="Diagnoses etc with request (0040,1002)", - formalDefinition="Diagnoses etc provided with request" - ) - private StringDt myClinicalInformation; - - @Child(name="procedure", type=CodingDt.class, order=13, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Type of procedure performed (0008,1032)", - formalDefinition="Type of procedure performed" - ) - private java.util.List myProcedure; - - @Child(name="interpreter", order=14, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class }) - @Description( - shortDefinition="Who interpreted images (0008,1060)", - formalDefinition="Who read study and interpreted the images" - ) - private ResourceReferenceDt myInterpreter; - - @Child(name="description", type=StringDt.class, order=15, min=0, max=1) - @Description( - shortDefinition="Institution-generated description (0008,1030)", - formalDefinition="Institution-generated description or classification of the Study (component) performed" - ) - private StringDt myDescription; - - @Child(name="series", order=16, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Each study has one or more series of instances", - formalDefinition="Each study has one or more series of image instances" - ) - private java.util.List mySeries; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myDateTime, mySubject, myUid, myAccessionNo, myIdentifier, myOrder, myModality, myReferrer, myAvailability, myUrl, myNumberOfSeries, myNumberOfInstances, myClinicalInformation, myProcedure, myInterpreter, myDescription, mySeries); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myDateTime, mySubject, myUid, myAccessionNo, myIdentifier, myOrder, myModality, myReferrer, myAvailability, myUrl, myNumberOfSeries, myNumberOfInstances, myClinicalInformation, myProcedure, myInterpreter, myDescription, mySeries); - } - - /** - * Gets the value(s) for dateTime (When the study was performed). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Date and Time the study took place - *

- */ - public DateTimeDt getDateTime() { - if (myDateTime == null) { - myDateTime = new DateTimeDt(); - } - return myDateTime; - } - - /** - * Sets the value(s) for dateTime (When the study was performed) - * - *

- * Definition: - * Date and Time the study took place - *

- */ - public ImagingStudy setDateTime(DateTimeDt theValue) { - myDateTime = theValue; - return this; - } - - /** - * Sets the value for dateTime (When the study was performed) - * - *

- * Definition: - * Date and Time the study took place - *

- */ - public ImagingStudy setDateTimeWithSecondsPrecision( Date theDate) { - myDateTime = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for dateTime (When the study was performed) - * - *

- * Definition: - * Date and Time the study took place - *

- */ - public ImagingStudy setDateTime( Date theDate, TemporalPrecisionEnum thePrecision) { - myDateTime = new DateTimeDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for subject (Who the images are of). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Who the images are of - *

- */ - public ResourceReferenceDt getSubject() { - if (mySubject == null) { - mySubject = new ResourceReferenceDt(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (Who the images are of) - * - *

- * Definition: - * Who the images are of - *

- */ - public ImagingStudy setSubject(ResourceReferenceDt theValue) { - mySubject = theValue; - return this; - } - - - /** - * Gets the value(s) for uid (Formal identifier for the study (0020,000D)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Formal identifier for the study - *

- */ - public OidDt getUid() { - if (myUid == null) { - myUid = new OidDt(); - } - return myUid; - } - - /** - * Sets the value(s) for uid (Formal identifier for the study (0020,000D)) - * - *

- * Definition: - * Formal identifier for the study - *

- */ - public ImagingStudy setUid(OidDt theValue) { - myUid = theValue; - return this; - } - - - /** - * Gets the value(s) for accessionNo (Accession Number (0008,0050)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Accession Number - *

- */ - public IdentifierDt getAccessionNo() { - if (myAccessionNo == null) { - myAccessionNo = new IdentifierDt(); - } - return myAccessionNo; - } - - /** - * Sets the value(s) for accessionNo (Accession Number (0008,0050)) - * - *

- * Definition: - * Accession Number - *

- */ - public ImagingStudy setAccessionNo(IdentifierDt theValue) { - myAccessionNo = theValue; - return this; - } - - /** - * Sets the value for accessionNo (Accession Number (0008,0050)) - * - *

- * Definition: - * Accession Number - *

- */ - public ImagingStudy setAccessionNo( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - myAccessionNo = new IdentifierDt(theUse, theSystem, theValue, theLabel); - return this; - } - - /** - * Sets the value for accessionNo (Accession Number (0008,0050)) - * - *

- * Definition: - * Accession Number - *

- */ - public ImagingStudy setAccessionNo( String theSystem, String theValue) { - myAccessionNo = new IdentifierDt(theSystem, theValue); - return this; - } - - - /** - * Gets the value(s) for identifier (Other identifiers for the study (0020,0010)). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Other identifiers for the study (0020,0010)) - * - *

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

- */ - public ImagingStudy setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (Other identifiers for the study (0020,0010)) - * - *

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

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (Other identifiers for the study (0020,0010)), - * creating it if it does not already exist. - * - *

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

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (Other identifiers for the study (0020,0010)) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public ImagingStudy addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (Other identifiers for the study (0020,0010)) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public ImagingStudy addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for order (Order(s) that caused this study to be performed). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getOrder() { - if (myOrder == null) { - myOrder = new java.util.ArrayList(); - } - return myOrder; - } - - /** - * Sets the value(s) for order (Order(s) that caused this study to be performed) - * - *

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

- */ - public ImagingStudy setOrder(java.util.List theValue) { - myOrder = theValue; - return this; - } - - /** - * Adds and returns a new value for order (Order(s) that caused this study to be performed) - * - *

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

- */ - public ResourceReferenceDt addOrder() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getOrder().add(newType); - return newType; - } - - /** - * Gets the value(s) for modality (All series.modality if actual acquisition modalities). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19) - *

- */ - public java.util.List> getModality() { - if (myModality == null) { - myModality = new java.util.ArrayList>(); - } - return myModality; - } - - /** - * Sets the value(s) for modality (All series.modality if actual acquisition modalities) - * - *

- * Definition: - * A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19) - *

- */ - public ImagingStudy setModality(java.util.List> theValue) { - myModality = theValue; - return this; - } - - /** - * Add a value for modality (All series.modality if actual acquisition modalities) 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: - * A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19) - *

- */ - public BoundCodeDt addModality(ImagingModalityEnum theValue) { - BoundCodeDt retVal = new BoundCodeDt(ImagingModalityEnum.VALUESET_BINDER, theValue); - getModality().add(retVal); - return retVal; - } - - /** - * Gets the first repetition for modality (All series.modality if actual acquisition modalities), - * creating it if it does not already exist. - * - *

- * Definition: - * A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19) - *

- */ - public BoundCodeDt getModalityFirstRep() { - if (getModality().size() == 0) { - addModality(); - } - return getModality().get(0); - } - - /** - * Add a value for modality (All series.modality if actual acquisition modalities) - * - *

- * Definition: - * A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19) - *

- */ - public BoundCodeDt addModality() { - BoundCodeDt retVal = new BoundCodeDt(ImagingModalityEnum.VALUESET_BINDER); - getModality().add(retVal); - return retVal; - } - - /** - * Sets the value(s), and clears any existing value(s) for modality (All series.modality if actual acquisition modalities) - * - *

- * Definition: - * A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19) - *

- */ - public ImagingStudy setModality(ImagingModalityEnum theValue) { - getModality().clear(); - addModality(theValue); - return this; - } - - - /** - * Gets the value(s) for referrer (Referring physician (0008,0090)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The requesting/referring physician - *

- */ - public ResourceReferenceDt getReferrer() { - if (myReferrer == null) { - myReferrer = new ResourceReferenceDt(); - } - return myReferrer; - } - - /** - * Sets the value(s) for referrer (Referring physician (0008,0090)) - * - *

- * Definition: - * The requesting/referring physician - *

- */ - public ImagingStudy setReferrer(ResourceReferenceDt theValue) { - myReferrer = theValue; - return this; - } - - - /** - * Gets the value(s) for availability (ONLINE | OFFLINE | NEARLINE | UNAVAILABLE (0008,0056)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Availability of study (online, offline or nearline) - *

- */ - public BoundCodeDt getAvailability() { - if (myAvailability == null) { - myAvailability = new BoundCodeDt(InstanceAvailabilityEnum.VALUESET_BINDER); - } - return myAvailability; - } - - /** - * Sets the value(s) for availability (ONLINE | OFFLINE | NEARLINE | UNAVAILABLE (0008,0056)) - * - *

- * Definition: - * Availability of study (online, offline or nearline) - *

- */ - public ImagingStudy setAvailability(BoundCodeDt theValue) { - myAvailability = theValue; - return this; - } - - /** - * Sets the value(s) for availability (ONLINE | OFFLINE | NEARLINE | UNAVAILABLE (0008,0056)) - * - *

- * Definition: - * Availability of study (online, offline or nearline) - *

- */ - public ImagingStudy setAvailability(InstanceAvailabilityEnum theValue) { - getAvailability().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for url (Retrieve URI (0008,1190)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * WADO-RS URI where Study is available - *

- */ - public UriDt getUrl() { - if (myUrl == null) { - myUrl = new UriDt(); - } - return myUrl; - } - - /** - * Sets the value(s) for url (Retrieve URI (0008,1190)) - * - *

- * Definition: - * WADO-RS URI where Study is available - *

- */ - public ImagingStudy setUrl(UriDt theValue) { - myUrl = theValue; - return this; - } - - /** - * Sets the value for url (Retrieve URI (0008,1190)) - * - *

- * Definition: - * WADO-RS URI where Study is available - *

- */ - public ImagingStudy setUrl( String theUri) { - myUrl = new UriDt(theUri); - return this; - } - - - /** - * Gets the value(s) for numberOfSeries (Number of Study Related Series (0020,1206)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Number of Series in Study - *

- */ - public IntegerDt getNumberOfSeries() { - if (myNumberOfSeries == null) { - myNumberOfSeries = new IntegerDt(); - } - return myNumberOfSeries; - } - - /** - * Sets the value(s) for numberOfSeries (Number of Study Related Series (0020,1206)) - * - *

- * Definition: - * Number of Series in Study - *

- */ - public ImagingStudy setNumberOfSeries(IntegerDt theValue) { - myNumberOfSeries = theValue; - return this; - } - - /** - * Sets the value for numberOfSeries (Number of Study Related Series (0020,1206)) - * - *

- * Definition: - * Number of Series in Study - *

- */ - public ImagingStudy setNumberOfSeries( int theInteger) { - myNumberOfSeries = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for numberOfInstances (Number of Study Related Instances (0020,1208)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Number of SOP Instances in Study - *

- */ - public IntegerDt getNumberOfInstances() { - if (myNumberOfInstances == null) { - myNumberOfInstances = new IntegerDt(); - } - return myNumberOfInstances; - } - - /** - * Sets the value(s) for numberOfInstances (Number of Study Related Instances (0020,1208)) - * - *

- * Definition: - * Number of SOP Instances in Study - *

- */ - public ImagingStudy setNumberOfInstances(IntegerDt theValue) { - myNumberOfInstances = theValue; - return this; - } - - /** - * Sets the value for numberOfInstances (Number of Study Related Instances (0020,1208)) - * - *

- * Definition: - * Number of SOP Instances in Study - *

- */ - public ImagingStudy setNumberOfInstances( int theInteger) { - myNumberOfInstances = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for clinicalInformation (Diagnoses etc with request (0040,1002)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Diagnoses etc provided with request - *

- */ - public StringDt getClinicalInformation() { - if (myClinicalInformation == null) { - myClinicalInformation = new StringDt(); - } - return myClinicalInformation; - } - - /** - * Sets the value(s) for clinicalInformation (Diagnoses etc with request (0040,1002)) - * - *

- * Definition: - * Diagnoses etc provided with request - *

- */ - public ImagingStudy setClinicalInformation(StringDt theValue) { - myClinicalInformation = theValue; - return this; - } - - /** - * Sets the value for clinicalInformation (Diagnoses etc with request (0040,1002)) - * - *

- * Definition: - * Diagnoses etc provided with request - *

- */ - public ImagingStudy setClinicalInformation( String theString) { - myClinicalInformation = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for procedure (Type of procedure performed (0008,1032)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Type of procedure performed - *

- */ - public java.util.List getProcedure() { - if (myProcedure == null) { - myProcedure = new java.util.ArrayList(); - } - return myProcedure; - } - - /** - * Sets the value(s) for procedure (Type of procedure performed (0008,1032)) - * - *

- * Definition: - * Type of procedure performed - *

- */ - public ImagingStudy setProcedure(java.util.List theValue) { - myProcedure = theValue; - return this; - } - - /** - * Adds and returns a new value for procedure (Type of procedure performed (0008,1032)) - * - *

- * Definition: - * Type of procedure performed - *

- */ - public CodingDt addProcedure() { - CodingDt newType = new CodingDt(); - getProcedure().add(newType); - return newType; - } - - /** - * Gets the first repetition for procedure (Type of procedure performed (0008,1032)), - * creating it if it does not already exist. - * - *

- * Definition: - * Type of procedure performed - *

- */ - public CodingDt getProcedureFirstRep() { - if (getProcedure().isEmpty()) { - return addProcedure(); - } - return getProcedure().get(0); - } - - /** - * Gets the value(s) for interpreter (Who interpreted images (0008,1060)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Who read study and interpreted the images - *

- */ - public ResourceReferenceDt getInterpreter() { - if (myInterpreter == null) { - myInterpreter = new ResourceReferenceDt(); - } - return myInterpreter; - } - - /** - * Sets the value(s) for interpreter (Who interpreted images (0008,1060)) - * - *

- * Definition: - * Who read study and interpreted the images - *

- */ - public ImagingStudy setInterpreter(ResourceReferenceDt theValue) { - myInterpreter = theValue; - return this; - } - - - /** - * Gets the value(s) for description (Institution-generated description (0008,1030)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Institution-generated description or classification of the Study (component) performed - *

- */ - public StringDt getDescription() { - if (myDescription == null) { - myDescription = new StringDt(); - } - return myDescription; - } - - /** - * Sets the value(s) for description (Institution-generated description (0008,1030)) - * - *

- * Definition: - * Institution-generated description or classification of the Study (component) performed - *

- */ - public ImagingStudy setDescription(StringDt theValue) { - myDescription = theValue; - return this; - } - - /** - * Sets the value for description (Institution-generated description (0008,1030)) - * - *

- * Definition: - * Institution-generated description or classification of the Study (component) performed - *

- */ - public ImagingStudy setDescription( String theString) { - myDescription = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for series (Each study has one or more series of instances). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getSeries() { - if (mySeries == null) { - mySeries = new java.util.ArrayList(); - } - return mySeries; - } - - /** - * Sets the value(s) for series (Each study has one or more series of instances) - * - *

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

- */ - public ImagingStudy setSeries(java.util.List theValue) { - mySeries = theValue; - return this; - } - - /** - * Adds and returns a new value for series (Each study has one or more series of instances) - * - *

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

- */ - public Series addSeries() { - Series newType = new Series(); - getSeries().add(newType); - return newType; - } - - /** - * Gets the first repetition for series (Each study has one or more series of instances), - * creating it if it does not already exist. - * - *

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

- */ - public Series getSeriesFirstRep() { - if (getSeries().isEmpty()) { - return addSeries(); - } - return getSeries().get(0); - } - - /** - * Block class for child element: ImagingStudy.series (Each study has one or more series of instances) - * - *

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

- */ - @Block() - public static class Series extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="number", type=IntegerDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Number of this series in overall sequence (0020,0011)", - formalDefinition="The number of this series in the overall sequence" - ) - private IntegerDt myNumber; - - @Child(name="modality", type=CodeDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="The modality of the instances in the series (0008,0060)", - formalDefinition="The modality of this series sequence" - ) - private BoundCodeDt myModality; - - @Child(name="uid", type=OidDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="Formal identifier for this series (0020,000E)", - formalDefinition="Formal identifier for this series" - ) - private OidDt myUid; - - @Child(name="description", type=StringDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="A description of the series (0008,103E)", - formalDefinition="A description of the series" - ) - private StringDt myDescription; - - @Child(name="numberOfInstances", type=IntegerDt.class, order=4, min=1, max=1) - @Description( - shortDefinition="Number of Series Related Instances (0020,1209)", - formalDefinition="Sequence that contains attributes from the" - ) - private IntegerDt myNumberOfInstances; - - @Child(name="availability", type=CodeDt.class, order=5, min=0, max=1) - @Description( - shortDefinition="ONLINE | OFFLINE | NEARLINE | UNAVAILABLE (0008,0056)", - formalDefinition="Availability of series (online, offline or nearline)" - ) - private BoundCodeDt myAvailability; - - @Child(name="url", type=UriDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="Retrieve URI (0008,1115 > 0008,1190)", - formalDefinition="WADO-RS URI where Series is available" - ) - private UriDt myUrl; - - @Child(name="bodySite", type=CodingDt.class, order=7, min=0, max=1) - @Description( - shortDefinition="Body part examined (Map from 0018,0015)", - formalDefinition="Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed" - ) - private CodingDt myBodySite; - - @Child(name="dateTime", type=DateTimeDt.class, order=8, min=0, max=1) - @Description( - shortDefinition="When the series started", - formalDefinition="" - ) - private DateTimeDt myDateTime; - - @Child(name="instance", order=9, min=1, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="A single instance taken from a patient (image or other)", - formalDefinition="A single image taken from a patient" - ) - private java.util.List myInstance; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myNumber, myModality, myUid, myDescription, myNumberOfInstances, myAvailability, myUrl, myBodySite, myDateTime, myInstance); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myNumber, myModality, myUid, myDescription, myNumberOfInstances, myAvailability, myUrl, myBodySite, myDateTime, myInstance); - } - - /** - * Gets the value(s) for number (Number of this series in overall sequence (0020,0011)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The number of this series in the overall sequence - *

- */ - public IntegerDt getNumber() { - if (myNumber == null) { - myNumber = new IntegerDt(); - } - return myNumber; - } - - /** - * Sets the value(s) for number (Number of this series in overall sequence (0020,0011)) - * - *

- * Definition: - * The number of this series in the overall sequence - *

- */ - public Series setNumber(IntegerDt theValue) { - myNumber = theValue; - return this; - } - - /** - * Sets the value for number (Number of this series in overall sequence (0020,0011)) - * - *

- * Definition: - * The number of this series in the overall sequence - *

- */ - public Series setNumber( int theInteger) { - myNumber = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for modality (The modality of the instances in the series (0008,0060)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The modality of this series sequence - *

- */ - public BoundCodeDt getModality() { - if (myModality == null) { - myModality = new BoundCodeDt(ModalityEnum.VALUESET_BINDER); - } - return myModality; - } - - /** - * Sets the value(s) for modality (The modality of the instances in the series (0008,0060)) - * - *

- * Definition: - * The modality of this series sequence - *

- */ - public Series setModality(BoundCodeDt theValue) { - myModality = theValue; - return this; - } - - /** - * Sets the value(s) for modality (The modality of the instances in the series (0008,0060)) - * - *

- * Definition: - * The modality of this series sequence - *

- */ - public Series setModality(ModalityEnum theValue) { - getModality().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for uid (Formal identifier for this series (0020,000E)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Formal identifier for this series - *

- */ - public OidDt getUid() { - if (myUid == null) { - myUid = new OidDt(); - } - return myUid; - } - - /** - * Sets the value(s) for uid (Formal identifier for this series (0020,000E)) - * - *

- * Definition: - * Formal identifier for this series - *

- */ - public Series setUid(OidDt theValue) { - myUid = theValue; - return this; - } - - - /** - * Gets the value(s) for description (A description of the series (0008,103E)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A description of the series - *

- */ - public StringDt getDescription() { - if (myDescription == null) { - myDescription = new StringDt(); - } - return myDescription; - } - - /** - * Sets the value(s) for description (A description of the series (0008,103E)) - * - *

- * Definition: - * A description of the series - *

- */ - public Series setDescription(StringDt theValue) { - myDescription = theValue; - return this; - } - - /** - * Sets the value for description (A description of the series (0008,103E)) - * - *

- * Definition: - * A description of the series - *

- */ - public Series setDescription( String theString) { - myDescription = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for numberOfInstances (Number of Series Related Instances (0020,1209)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Sequence that contains attributes from the - *

- */ - public IntegerDt getNumberOfInstances() { - if (myNumberOfInstances == null) { - myNumberOfInstances = new IntegerDt(); - } - return myNumberOfInstances; - } - - /** - * Sets the value(s) for numberOfInstances (Number of Series Related Instances (0020,1209)) - * - *

- * Definition: - * Sequence that contains attributes from the - *

- */ - public Series setNumberOfInstances(IntegerDt theValue) { - myNumberOfInstances = theValue; - return this; - } - - /** - * Sets the value for numberOfInstances (Number of Series Related Instances (0020,1209)) - * - *

- * Definition: - * Sequence that contains attributes from the - *

- */ - public Series setNumberOfInstances( int theInteger) { - myNumberOfInstances = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for availability (ONLINE | OFFLINE | NEARLINE | UNAVAILABLE (0008,0056)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Availability of series (online, offline or nearline) - *

- */ - public BoundCodeDt getAvailability() { - if (myAvailability == null) { - myAvailability = new BoundCodeDt(InstanceAvailabilityEnum.VALUESET_BINDER); - } - return myAvailability; - } - - /** - * Sets the value(s) for availability (ONLINE | OFFLINE | NEARLINE | UNAVAILABLE (0008,0056)) - * - *

- * Definition: - * Availability of series (online, offline or nearline) - *

- */ - public Series setAvailability(BoundCodeDt theValue) { - myAvailability = theValue; - return this; - } - - /** - * Sets the value(s) for availability (ONLINE | OFFLINE | NEARLINE | UNAVAILABLE (0008,0056)) - * - *

- * Definition: - * Availability of series (online, offline or nearline) - *

- */ - public Series setAvailability(InstanceAvailabilityEnum theValue) { - getAvailability().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for url (Retrieve URI (0008,1115 > 0008,1190)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * WADO-RS URI where Series is available - *

- */ - public UriDt getUrl() { - if (myUrl == null) { - myUrl = new UriDt(); - } - return myUrl; - } - - /** - * Sets the value(s) for url (Retrieve URI (0008,1115 > 0008,1190)) - * - *

- * Definition: - * WADO-RS URI where Series is available - *

- */ - public Series setUrl(UriDt theValue) { - myUrl = theValue; - return this; - } - - /** - * Sets the value for url (Retrieve URI (0008,1115 > 0008,1190)) - * - *

- * Definition: - * WADO-RS URI where Series is available - *

- */ - public Series setUrl( String theUri) { - myUrl = new UriDt(theUri); - return this; - } - - - /** - * Gets the value(s) for bodySite (Body part examined (Map from 0018,0015)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed - *

- */ - public CodingDt getBodySite() { - if (myBodySite == null) { - myBodySite = new CodingDt(); - } - return myBodySite; - } - - /** - * Sets the value(s) for bodySite (Body part examined (Map from 0018,0015)) - * - *

- * Definition: - * Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed - *

- */ - public Series setBodySite(CodingDt theValue) { - myBodySite = theValue; - return this; - } - - - /** - * Gets the value(s) for dateTime (When the series started). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public DateTimeDt getDateTime() { - if (myDateTime == null) { - myDateTime = new DateTimeDt(); - } - return myDateTime; - } - - /** - * Sets the value(s) for dateTime (When the series started) - * - *

- * Definition: - * - *

- */ - public Series setDateTime(DateTimeDt theValue) { - myDateTime = theValue; - return this; - } - - /** - * Sets the value for dateTime (When the series started) - * - *

- * Definition: - * - *

- */ - public Series setDateTimeWithSecondsPrecision( Date theDate) { - myDateTime = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for dateTime (When the series started) - * - *

- * Definition: - * - *

- */ - public Series setDateTime( Date theDate, TemporalPrecisionEnum thePrecision) { - myDateTime = new DateTimeDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for instance (A single instance taken from a patient (image or other)). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getInstance() { - if (myInstance == null) { - myInstance = new java.util.ArrayList(); - } - return myInstance; - } - - /** - * Sets the value(s) for instance (A single instance taken from a patient (image or other)) - * - *

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

- */ - public Series setInstance(java.util.List theValue) { - myInstance = theValue; - return this; - } - - /** - * Adds and returns a new value for instance (A single instance taken from a patient (image or other)) - * - *

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

- */ - public SeriesInstance addInstance() { - SeriesInstance newType = new SeriesInstance(); - getInstance().add(newType); - return newType; - } - - /** - * Gets the first repetition for instance (A single instance taken from a patient (image or other)), - * creating it if it does not already exist. - * - *

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

- */ - public SeriesInstance getInstanceFirstRep() { - if (getInstance().isEmpty()) { - return addInstance(); - } - return getInstance().get(0); - } - - - } - - /** - * Block class for child element: ImagingStudy.series.instance (A single instance taken from a patient (image or other)) - * - *

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

- */ - @Block() - public static class SeriesInstance extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="number", type=IntegerDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="The number of this instance in the series (0020,0013)", - formalDefinition="The number of this image in the series" - ) - private IntegerDt myNumber; - - @Child(name="uid", type=OidDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="Formal identifier for this instance (0008,0018)", - formalDefinition="Formal identifier for this image" - ) - private OidDt myUid; - - @Child(name="sopclass", type=OidDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="DICOM class type (0008,0016)", - formalDefinition="DICOM Image type" - ) - private OidDt mySopclass; - - @Child(name="type", type=StringDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Type of instance (image etc) (0004,1430)", - formalDefinition="" - ) - private StringDt myType; - - @Child(name="title", type=StringDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="Description (0070,0080 | 0040,A043 > 0008,0104 | 0042,0010 | 0008,0008)", - formalDefinition="" - ) - private StringDt myTitle; - - @Child(name="url", type=UriDt.class, order=5, min=0, max=1) - @Description( - shortDefinition="WADO-RS service where instance is available (0008,1199 > 0008,1190)", - formalDefinition="WADO-RS url where image is available" - ) - private UriDt myUrl; - - @Child(name="attachment", order=6, min=0, max=1, type={ - IResource.class }) - @Description( - shortDefinition="A FHIR resource with content for this instance", - formalDefinition="" - ) - private ResourceReferenceDt myAttachment; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myNumber, myUid, mySopclass, myType, myTitle, myUrl, myAttachment); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myNumber, myUid, mySopclass, myType, myTitle, myUrl, myAttachment); - } - - /** - * Gets the value(s) for number (The number of this instance in the series (0020,0013)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The number of this image in the series - *

- */ - public IntegerDt getNumber() { - if (myNumber == null) { - myNumber = new IntegerDt(); - } - return myNumber; - } - - /** - * Sets the value(s) for number (The number of this instance in the series (0020,0013)) - * - *

- * Definition: - * The number of this image in the series - *

- */ - public SeriesInstance setNumber(IntegerDt theValue) { - myNumber = theValue; - return this; - } - - /** - * Sets the value for number (The number of this instance in the series (0020,0013)) - * - *

- * Definition: - * The number of this image in the series - *

- */ - public SeriesInstance setNumber( int theInteger) { - myNumber = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for uid (Formal identifier for this instance (0008,0018)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Formal identifier for this image - *

- */ - public OidDt getUid() { - if (myUid == null) { - myUid = new OidDt(); - } - return myUid; - } - - /** - * Sets the value(s) for uid (Formal identifier for this instance (0008,0018)) - * - *

- * Definition: - * Formal identifier for this image - *

- */ - public SeriesInstance setUid(OidDt theValue) { - myUid = theValue; - return this; - } - - - /** - * Gets the value(s) for sopclass (DICOM class type (0008,0016)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * DICOM Image type - *

- */ - public OidDt getSopclass() { - if (mySopclass == null) { - mySopclass = new OidDt(); - } - return mySopclass; - } - - /** - * Sets the value(s) for sopclass (DICOM class type (0008,0016)) - * - *

- * Definition: - * DICOM Image type - *

- */ - public SeriesInstance setSopclass(OidDt theValue) { - mySopclass = theValue; - return this; - } - - - /** - * Gets the value(s) for type (Type of instance (image etc) (0004,1430)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public StringDt getType() { - if (myType == null) { - myType = new StringDt(); - } - return myType; - } - - /** - * Sets the value(s) for type (Type of instance (image etc) (0004,1430)) - * - *

- * Definition: - * - *

- */ - public SeriesInstance setType(StringDt theValue) { - myType = theValue; - return this; - } - - /** - * Sets the value for type (Type of instance (image etc) (0004,1430)) - * - *

- * Definition: - * - *

- */ - public SeriesInstance setType( String theString) { - myType = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for title (Description (0070,0080 | 0040,A043 > 0008,0104 | 0042,0010 | 0008,0008)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public StringDt getTitle() { - if (myTitle == null) { - myTitle = new StringDt(); - } - return myTitle; - } - - /** - * Sets the value(s) for title (Description (0070,0080 | 0040,A043 > 0008,0104 | 0042,0010 | 0008,0008)) - * - *

- * Definition: - * - *

- */ - public SeriesInstance setTitle(StringDt theValue) { - myTitle = theValue; - return this; - } - - /** - * Sets the value for title (Description (0070,0080 | 0040,A043 > 0008,0104 | 0042,0010 | 0008,0008)) - * - *

- * Definition: - * - *

- */ - public SeriesInstance setTitle( String theString) { - myTitle = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for url (WADO-RS service where instance is available (0008,1199 > 0008,1190)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * WADO-RS url where image is available - *

- */ - public UriDt getUrl() { - if (myUrl == null) { - myUrl = new UriDt(); - } - return myUrl; - } - - /** - * Sets the value(s) for url (WADO-RS service where instance is available (0008,1199 > 0008,1190)) - * - *

- * Definition: - * WADO-RS url where image is available - *

- */ - public SeriesInstance setUrl(UriDt theValue) { - myUrl = theValue; - return this; - } - - /** - * Sets the value for url (WADO-RS service where instance is available (0008,1199 > 0008,1190)) - * - *

- * Definition: - * WADO-RS url where image is available - *

- */ - public SeriesInstance setUrl( String theUri) { - myUrl = new UriDt(theUri); - return this; - } - - - /** - * Gets the value(s) for attachment (A FHIR resource with content for this instance). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt getAttachment() { - if (myAttachment == null) { - myAttachment = new ResourceReferenceDt(); - } - return myAttachment; - } - - /** - * Sets the value(s) for attachment (A FHIR resource with content for this instance) - * - *

- * Definition: - * - *

- */ - public SeriesInstance setAttachment(ResourceReferenceDt theValue) { - myAttachment = theValue; - return this; - } - - - - } - - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Immunization.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Immunization.java deleted file mode 100644 index 0abf3367386..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Immunization.java +++ /dev/null @@ -1,2213 +0,0 @@ - - - - - - - - - - - - - - - - -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.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.ImmunizationReasonCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.ImmunizationRouteCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; -import ca.uhn.fhir.model.primitive.BooleanDt; -import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; -import ca.uhn.fhir.model.primitive.DateDt; -import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.rest.gclient.DateClientParam; -import ca.uhn.fhir.rest.gclient.NumberClientParam; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.StringClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR Immunization Resource - * (Immunization event information) - * - *

- * Definition: - * Immunization event information - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Immunization - *

- * - */ -@ResourceDef(name="Immunization", profile="http://hl7.org/fhir/profiles/Immunization", id="immunization") -public class Immunization extends BaseResource implements IResource { - - /** - * Search parameter constant for date - *

- * Description: Vaccination Administration / Refusal Date
- * Type: date
- * Path: Immunization.date
- *

- */ - @SearchParamDefinition(name="date", path="Immunization.date", description="Vaccination Administration / Refusal Date", type="date" ) - public static final String SP_DATE = "date"; - - /** - * Fluent Client search parameter constant for date - *

- * Description: Vaccination Administration / Refusal Date
- * Type: date
- * Path: Immunization.date
- *

- */ - public static final DateClientParam DATE = new DateClientParam(SP_DATE); - - /** - * Search parameter constant for dose-sequence - *

- * Description:
- * Type: number
- * Path: Immunization.vaccinationProtocol.doseSequence
- *

- */ - @SearchParamDefinition(name="dose-sequence", path="Immunization.vaccinationProtocol.doseSequence", description="", type="number" ) - public static final String SP_DOSE_SEQUENCE = "dose-sequence"; - - /** - * Fluent Client search parameter constant for dose-sequence - *

- * Description:
- * Type: number
- * Path: Immunization.vaccinationProtocol.doseSequence
- *

- */ - public static final NumberClientParam DOSE_SEQUENCE = new NumberClientParam(SP_DOSE_SEQUENCE); - - /** - * Search parameter constant for identifier - *

- * Description:
- * Type: token
- * Path: Immunization.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Immunization.identifier", description="", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - - /** - * Fluent Client search parameter constant for identifier - *

- * Description:
- * Type: token
- * Path: Immunization.identifier
- *

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

- * Description: The service delivery location or facility in which the vaccine was / was to be administered
- * Type: reference
- * Path: Immunization.location
- *

- */ - @SearchParamDefinition(name="location", path="Immunization.location", description="The service delivery location or facility in which the vaccine was / was to be administered", type="reference" ) - public static final String SP_LOCATION = "location"; - - /** - * Fluent Client search parameter constant for location - *

- * Description: The service delivery location or facility in which the vaccine was / was to be administered
- * Type: reference
- * Path: Immunization.location
- *

- */ - public static final ReferenceClientParam LOCATION = new ReferenceClientParam(SP_LOCATION); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Immunization.location". - */ - public static final Include INCLUDE_LOCATION = new Include("Immunization.location"); - - /** - * Search parameter constant for lot-number - *

- * Description: Vaccine Lot Number
- * Type: string
- * Path: Immunization.lotNumber
- *

- */ - @SearchParamDefinition(name="lot-number", path="Immunization.lotNumber", description="Vaccine Lot Number", type="string" ) - public static final String SP_LOT_NUMBER = "lot-number"; - - /** - * Fluent Client search parameter constant for lot-number - *

- * Description: Vaccine Lot Number
- * Type: string
- * Path: Immunization.lotNumber
- *

- */ - public static final StringClientParam LOT_NUMBER = new StringClientParam(SP_LOT_NUMBER); - - /** - * Search parameter constant for manufacturer - *

- * Description: Vaccine Manufacturer
- * Type: reference
- * Path: Immunization.manufacturer
- *

- */ - @SearchParamDefinition(name="manufacturer", path="Immunization.manufacturer", description="Vaccine Manufacturer", type="reference" ) - public static final String SP_MANUFACTURER = "manufacturer"; - - /** - * Fluent Client search parameter constant for manufacturer - *

- * Description: Vaccine Manufacturer
- * Type: reference
- * Path: Immunization.manufacturer
- *

- */ - public static final ReferenceClientParam MANUFACTURER = new ReferenceClientParam(SP_MANUFACTURER); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Immunization.manufacturer". - */ - public static final Include INCLUDE_MANUFACTURER = new Include("Immunization.manufacturer"); - - /** - * Search parameter constant for performer - *

- * Description: The practitioner who administered the vaccination
- * Type: reference
- * Path: Immunization.performer
- *

- */ - @SearchParamDefinition(name="performer", path="Immunization.performer", description="The practitioner who administered the vaccination", type="reference" ) - public static final String SP_PERFORMER = "performer"; - - /** - * Fluent Client search parameter constant for performer - *

- * Description: The practitioner who administered the vaccination
- * Type: reference
- * Path: Immunization.performer
- *

- */ - public static final ReferenceClientParam PERFORMER = new ReferenceClientParam(SP_PERFORMER); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Immunization.performer". - */ - public static final Include INCLUDE_PERFORMER = new Include("Immunization.performer"); - - /** - * Search parameter constant for reaction - *

- * Description:
- * Type: reference
- * Path: Immunization.reaction.detail
- *

- */ - @SearchParamDefinition(name="reaction", path="Immunization.reaction.detail", description="", type="reference" ) - public static final String SP_REACTION = "reaction"; - - /** - * Fluent Client search parameter constant for reaction - *

- * Description:
- * Type: reference
- * Path: Immunization.reaction.detail
- *

- */ - public static final ReferenceClientParam REACTION = new ReferenceClientParam(SP_REACTION); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Immunization.reaction.detail". - */ - public static final Include INCLUDE_REACTION_DETAIL = new Include("Immunization.reaction.detail"); - - /** - * Search parameter constant for reaction-date - *

- * Description:
- * Type: date
- * Path: Immunization.reaction.date
- *

- */ - @SearchParamDefinition(name="reaction-date", path="Immunization.reaction.date", description="", type="date" ) - public static final String SP_REACTION_DATE = "reaction-date"; - - /** - * Fluent Client search parameter constant for reaction-date - *

- * Description:
- * Type: date
- * Path: Immunization.reaction.date
- *

- */ - public static final DateClientParam REACTION_DATE = new DateClientParam(SP_REACTION_DATE); - - /** - * Search parameter constant for reason - *

- * Description:
- * Type: token
- * Path: Immunization.explanation.reason
- *

- */ - @SearchParamDefinition(name="reason", path="Immunization.explanation.reason", description="", type="token" ) - public static final String SP_REASON = "reason"; - - /** - * Fluent Client search parameter constant for reason - *

- * Description:
- * Type: token
- * Path: Immunization.explanation.reason
- *

- */ - public static final TokenClientParam REASON = new TokenClientParam(SP_REASON); - - /** - * Search parameter constant for refusal-reason - *

- * Description: Explanation of refusal / exemption
- * Type: token
- * Path: Immunization.explanation.refusalReason
- *

- */ - @SearchParamDefinition(name="refusal-reason", path="Immunization.explanation.refusalReason", description="Explanation of refusal / exemption", type="token" ) - public static final String SP_REFUSAL_REASON = "refusal-reason"; - - /** - * Fluent Client search parameter constant for refusal-reason - *

- * Description: Explanation of refusal / exemption
- * Type: token
- * Path: Immunization.explanation.refusalReason
- *

- */ - public static final TokenClientParam REFUSAL_REASON = new TokenClientParam(SP_REFUSAL_REASON); - - /** - * Search parameter constant for refused - *

- * Description:
- * Type: token
- * Path: Immunization.refusedIndicator
- *

- */ - @SearchParamDefinition(name="refused", path="Immunization.refusedIndicator", description="", type="token" ) - public static final String SP_REFUSED = "refused"; - - /** - * Fluent Client search parameter constant for refused - *

- * Description:
- * Type: token
- * Path: Immunization.refusedIndicator
- *

- */ - public static final TokenClientParam REFUSED = new TokenClientParam(SP_REFUSED); - - /** - * Search parameter constant for requester - *

- * Description: The practitioner who ordered the vaccination
- * Type: reference
- * Path: Immunization.requester
- *

- */ - @SearchParamDefinition(name="requester", path="Immunization.requester", description="The practitioner who ordered the vaccination", type="reference" ) - public static final String SP_REQUESTER = "requester"; - - /** - * Fluent Client search parameter constant for requester - *

- * Description: The practitioner who ordered the vaccination
- * Type: reference
- * Path: Immunization.requester
- *

- */ - public static final ReferenceClientParam REQUESTER = new ReferenceClientParam(SP_REQUESTER); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Immunization.requester". - */ - public static final Include INCLUDE_REQUESTER = new Include("Immunization.requester"); - - /** - * Search parameter constant for subject - *

- * Description: The subject of the vaccination event / refusal
- * Type: reference
- * Path: Immunization.subject
- *

- */ - @SearchParamDefinition(name="subject", path="Immunization.subject", description="The subject of the vaccination event / refusal", type="reference" ) - public static final String SP_SUBJECT = "subject"; - - /** - * Fluent Client search parameter constant for subject - *

- * Description: The subject of the vaccination event / refusal
- * Type: reference
- * Path: Immunization.subject
- *

- */ - public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Immunization.subject". - */ - public static final Include INCLUDE_SUBJECT = new Include("Immunization.subject"); - - /** - * Search parameter constant for vaccine-type - *

- * Description: Vaccine Product Type Administered
- * Type: token
- * Path: Immunization.vaccineType
- *

- */ - @SearchParamDefinition(name="vaccine-type", path="Immunization.vaccineType", description="Vaccine Product Type Administered", type="token" ) - public static final String SP_VACCINE_TYPE = "vaccine-type"; - - /** - * Fluent Client search parameter constant for vaccine-type - *

- * Description: Vaccine Product Type Administered
- * Type: token
- * Path: Immunization.vaccineType
- *

- */ - public static final TokenClientParam VACCINE_TYPE = new TokenClientParam(SP_VACCINE_TYPE); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Business identifier", - formalDefinition="A unique identifier assigned to this adverse reaction record." - ) - private java.util.List myIdentifier; - - @Child(name="date", type=DateTimeDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="Vaccination administration date", - formalDefinition="Date vaccine administered or was to be administered" - ) - private DateTimeDt myDate; - - @Child(name="vaccineType", type=CodeableConceptDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="Vaccine product administered", - formalDefinition="Vaccine that was administered or was to be administered" - ) - private CodeableConceptDt myVaccineType; - - @Child(name="subject", order=3, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="Who was immunized?", - formalDefinition="The patient to whom the vaccine was to be administered" - ) - private ResourceReferenceDt mySubject; - - @Child(name="refusedIndicator", type=BooleanDt.class, order=4, min=1, max=1) - @Description( - shortDefinition="Was immunization refused?", - formalDefinition="Indicates if the vaccination was refused." - ) - private BooleanDt myRefusedIndicator; - - @Child(name="reported", type=BooleanDt.class, order=5, min=1, max=1) - @Description( - shortDefinition="Is this a self-reported record?", - formalDefinition="True if this administration was reported rather than directly administered." - ) - private BooleanDt myReported; - - @Child(name="performer", order=6, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class }) - @Description( - shortDefinition="Who administered vaccine?", - formalDefinition="Clinician who administered the vaccine" - ) - private ResourceReferenceDt myPerformer; - - @Child(name="requester", order=7, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class }) - @Description( - shortDefinition="Who ordered vaccination?", - formalDefinition="Clinician who ordered the vaccination" - ) - private ResourceReferenceDt myRequester; - - @Child(name="manufacturer", order=8, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Organization.class }) - @Description( - shortDefinition="Vaccine manufacturer", - formalDefinition="Name of vaccine manufacturer" - ) - private ResourceReferenceDt myManufacturer; - - @Child(name="location", order=9, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Location.class }) - @Description( - shortDefinition="Where did vaccination occur?", - formalDefinition="The service delivery location where the vaccine administration occurred." - ) - private ResourceReferenceDt myLocation; - - @Child(name="lotNumber", type=StringDt.class, order=10, min=0, max=1) - @Description( - shortDefinition="Vaccine lot number", - formalDefinition="Lot number of the vaccine product" - ) - private StringDt myLotNumber; - - @Child(name="expirationDate", type=DateDt.class, order=11, min=0, max=1) - @Description( - shortDefinition="Vaccine expiration date", - formalDefinition="Date vaccine batch expires" - ) - private DateDt myExpirationDate; - - @Child(name="site", type=CodeableConceptDt.class, order=12, min=0, max=1) - @Description( - shortDefinition="Body site vaccine was administered", - formalDefinition="Body site where vaccine was administered" - ) - private CodeableConceptDt mySite; - - @Child(name="route", type=CodeableConceptDt.class, order=13, min=0, max=1) - @Description( - shortDefinition="How vaccine entered body", - formalDefinition="The path by which the vaccine product is taken into the body." - ) - private BoundCodeableConceptDt myRoute; - - @Child(name="doseQuantity", type=QuantityDt.class, order=14, min=0, max=1) - @Description( - shortDefinition="Amount of vaccine administered", - formalDefinition="The quantity of vaccine product that was administered" - ) - private QuantityDt myDoseQuantity; - - @Child(name="explanation", order=15, min=0, max=1) - @Description( - shortDefinition="Administration / refusal reasons", - formalDefinition="Reasons why a vaccine was administered or refused" - ) - private Explanation myExplanation; - - @Child(name="reaction", order=16, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Details of a reaction that follows immunization", - formalDefinition="Categorical data indicating that an adverse event is associated in time to an immunization" - ) - private java.util.List myReaction; - - @Child(name="vaccinationProtocol", order=17, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="What protocol was followed", - formalDefinition="Contains information about the protocol(s) under which the vaccine was administered" - ) - private java.util.List myVaccinationProtocol; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myDate, myVaccineType, mySubject, myRefusedIndicator, myReported, myPerformer, myRequester, myManufacturer, myLocation, myLotNumber, myExpirationDate, mySite, myRoute, myDoseQuantity, myExplanation, myReaction, myVaccinationProtocol); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myDate, myVaccineType, mySubject, myRefusedIndicator, myReported, myPerformer, myRequester, myManufacturer, myLocation, myLotNumber, myExpirationDate, mySite, myRoute, myDoseQuantity, myExplanation, myReaction, myVaccinationProtocol); - } - - /** - * Gets the value(s) for identifier (Business identifier). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A unique identifier assigned to this adverse reaction record. - *

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Business identifier) - * - *

- * Definition: - * A unique identifier assigned to this adverse reaction record. - *

- */ - public Immunization setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (Business identifier) - * - *

- * Definition: - * A unique identifier assigned to this adverse reaction record. - *

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (Business identifier), - * creating it if it does not already exist. - * - *

- * Definition: - * A unique identifier assigned to this adverse reaction record. - *

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (Business identifier) - * - *

- * Definition: - * A unique identifier assigned to this adverse reaction record. - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Immunization addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (Business identifier) - * - *

- * Definition: - * A unique identifier assigned to this adverse reaction record. - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Immunization addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for date (Vaccination administration date). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Date vaccine administered or was to be administered - *

- */ - public DateTimeDt getDate() { - if (myDate == null) { - myDate = new DateTimeDt(); - } - return myDate; - } - - /** - * Sets the value(s) for date (Vaccination administration date) - * - *

- * Definition: - * Date vaccine administered or was to be administered - *

- */ - public Immunization setDate(DateTimeDt theValue) { - myDate = theValue; - return this; - } - - /** - * Sets the value for date (Vaccination administration date) - * - *

- * Definition: - * Date vaccine administered or was to be administered - *

- */ - public Immunization setDateWithSecondsPrecision( Date theDate) { - myDate = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for date (Vaccination administration date) - * - *

- * Definition: - * Date vaccine administered or was to be administered - *

- */ - public Immunization setDate( Date theDate, TemporalPrecisionEnum thePrecision) { - myDate = new DateTimeDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for vaccineType (Vaccine product administered). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Vaccine that was administered or was to be administered - *

- */ - public CodeableConceptDt getVaccineType() { - if (myVaccineType == null) { - myVaccineType = new CodeableConceptDt(); - } - return myVaccineType; - } - - /** - * Sets the value(s) for vaccineType (Vaccine product administered) - * - *

- * Definition: - * Vaccine that was administered or was to be administered - *

- */ - public Immunization setVaccineType(CodeableConceptDt theValue) { - myVaccineType = theValue; - return this; - } - - - /** - * Gets the value(s) for subject (Who was immunized?). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The patient to whom the vaccine was to be administered - *

- */ - public ResourceReferenceDt getSubject() { - if (mySubject == null) { - mySubject = new ResourceReferenceDt(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (Who was immunized?) - * - *

- * Definition: - * The patient to whom the vaccine was to be administered - *

- */ - public Immunization setSubject(ResourceReferenceDt theValue) { - mySubject = theValue; - return this; - } - - - /** - * Gets the value(s) for refusedIndicator (Was immunization refused?). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates if the vaccination was refused. - *

- */ - public BooleanDt getRefusedIndicator() { - if (myRefusedIndicator == null) { - myRefusedIndicator = new BooleanDt(); - } - return myRefusedIndicator; - } - - /** - * Sets the value(s) for refusedIndicator (Was immunization refused?) - * - *

- * Definition: - * Indicates if the vaccination was refused. - *

- */ - public Immunization setRefusedIndicator(BooleanDt theValue) { - myRefusedIndicator = theValue; - return this; - } - - /** - * Sets the value for refusedIndicator (Was immunization refused?) - * - *

- * Definition: - * Indicates if the vaccination was refused. - *

- */ - public Immunization setRefusedIndicator( boolean theBoolean) { - myRefusedIndicator = new BooleanDt(theBoolean); - return this; - } - - - /** - * Gets the value(s) for reported (Is this a self-reported record?). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * True if this administration was reported rather than directly administered. - *

- */ - public BooleanDt getReported() { - if (myReported == null) { - myReported = new BooleanDt(); - } - return myReported; - } - - /** - * Sets the value(s) for reported (Is this a self-reported record?) - * - *

- * Definition: - * True if this administration was reported rather than directly administered. - *

- */ - public Immunization setReported(BooleanDt theValue) { - myReported = theValue; - return this; - } - - /** - * Sets the value for reported (Is this a self-reported record?) - * - *

- * Definition: - * True if this administration was reported rather than directly administered. - *

- */ - public Immunization setReported( boolean theBoolean) { - myReported = new BooleanDt(theBoolean); - return this; - } - - - /** - * Gets the value(s) for performer (Who administered vaccine?). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Clinician who administered the vaccine - *

- */ - public ResourceReferenceDt getPerformer() { - if (myPerformer == null) { - myPerformer = new ResourceReferenceDt(); - } - return myPerformer; - } - - /** - * Sets the value(s) for performer (Who administered vaccine?) - * - *

- * Definition: - * Clinician who administered the vaccine - *

- */ - public Immunization setPerformer(ResourceReferenceDt theValue) { - myPerformer = theValue; - return this; - } - - - /** - * Gets the value(s) for requester (Who ordered vaccination?). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Clinician who ordered the vaccination - *

- */ - public ResourceReferenceDt getRequester() { - if (myRequester == null) { - myRequester = new ResourceReferenceDt(); - } - return myRequester; - } - - /** - * Sets the value(s) for requester (Who ordered vaccination?) - * - *

- * Definition: - * Clinician who ordered the vaccination - *

- */ - public Immunization setRequester(ResourceReferenceDt theValue) { - myRequester = theValue; - return this; - } - - - /** - * Gets the value(s) for manufacturer (Vaccine manufacturer). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Name of vaccine manufacturer - *

- */ - public ResourceReferenceDt getManufacturer() { - if (myManufacturer == null) { - myManufacturer = new ResourceReferenceDt(); - } - return myManufacturer; - } - - /** - * Sets the value(s) for manufacturer (Vaccine manufacturer) - * - *

- * Definition: - * Name of vaccine manufacturer - *

- */ - public Immunization setManufacturer(ResourceReferenceDt theValue) { - myManufacturer = theValue; - return this; - } - - - /** - * Gets the value(s) for location (Where did vaccination occur?). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The service delivery location where the vaccine administration occurred. - *

- */ - public ResourceReferenceDt getLocation() { - if (myLocation == null) { - myLocation = new ResourceReferenceDt(); - } - return myLocation; - } - - /** - * Sets the value(s) for location (Where did vaccination occur?) - * - *

- * Definition: - * The service delivery location where the vaccine administration occurred. - *

- */ - public Immunization setLocation(ResourceReferenceDt theValue) { - myLocation = theValue; - return this; - } - - - /** - * Gets the value(s) for lotNumber (Vaccine lot number). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Lot number of the vaccine product - *

- */ - public StringDt getLotNumber() { - if (myLotNumber == null) { - myLotNumber = new StringDt(); - } - return myLotNumber; - } - - /** - * Sets the value(s) for lotNumber (Vaccine lot number) - * - *

- * Definition: - * Lot number of the vaccine product - *

- */ - public Immunization setLotNumber(StringDt theValue) { - myLotNumber = theValue; - return this; - } - - /** - * Sets the value for lotNumber (Vaccine lot number) - * - *

- * Definition: - * Lot number of the vaccine product - *

- */ - public Immunization setLotNumber( String theString) { - myLotNumber = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for expirationDate (Vaccine expiration date). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Date vaccine batch expires - *

- */ - public DateDt getExpirationDate() { - if (myExpirationDate == null) { - myExpirationDate = new DateDt(); - } - return myExpirationDate; - } - - /** - * Sets the value(s) for expirationDate (Vaccine expiration date) - * - *

- * Definition: - * Date vaccine batch expires - *

- */ - public Immunization setExpirationDate(DateDt theValue) { - myExpirationDate = theValue; - return this; - } - - /** - * Sets the value for expirationDate (Vaccine expiration date) - * - *

- * Definition: - * Date vaccine batch expires - *

- */ - public Immunization setExpirationDateWithDayPrecision( Date theDate) { - myExpirationDate = new DateDt(theDate); - return this; - } - - /** - * Sets the value for expirationDate (Vaccine expiration date) - * - *

- * Definition: - * Date vaccine batch expires - *

- */ - public Immunization setExpirationDate( Date theDate, TemporalPrecisionEnum thePrecision) { - myExpirationDate = new DateDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for site (Body site vaccine was administered). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Body site where vaccine was administered - *

- */ - public CodeableConceptDt getSite() { - if (mySite == null) { - mySite = new CodeableConceptDt(); - } - return mySite; - } - - /** - * Sets the value(s) for site (Body site vaccine was administered) - * - *

- * Definition: - * Body site where vaccine was administered - *

- */ - public Immunization setSite(CodeableConceptDt theValue) { - mySite = theValue; - return this; - } - - - /** - * Gets the value(s) for route (How vaccine entered body). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The path by which the vaccine product is taken into the body. - *

- */ - public BoundCodeableConceptDt getRoute() { - if (myRoute == null) { - myRoute = new BoundCodeableConceptDt(ImmunizationRouteCodesEnum.VALUESET_BINDER); - } - return myRoute; - } - - /** - * Sets the value(s) for route (How vaccine entered body) - * - *

- * Definition: - * The path by which the vaccine product is taken into the body. - *

- */ - public Immunization setRoute(BoundCodeableConceptDt theValue) { - myRoute = theValue; - return this; - } - - /** - * Sets the value(s) for route (How vaccine entered body) - * - *

- * Definition: - * The path by which the vaccine product is taken into the body. - *

- */ - public Immunization setRoute(ImmunizationRouteCodesEnum theValue) { - getRoute().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for doseQuantity (Amount of vaccine administered). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The quantity of vaccine product that was administered - *

- */ - public QuantityDt getDoseQuantity() { - if (myDoseQuantity == null) { - myDoseQuantity = new QuantityDt(); - } - return myDoseQuantity; - } - - /** - * Sets the value(s) for doseQuantity (Amount of vaccine administered) - * - *

- * Definition: - * The quantity of vaccine product that was administered - *

- */ - public Immunization setDoseQuantity(QuantityDt theValue) { - myDoseQuantity = theValue; - return this; - } - - /** - * Sets the value for doseQuantity (Amount of vaccine administered) - * - *

- * Definition: - * The quantity of vaccine product that was administered - *

- */ - public Immunization setDoseQuantity( QuantityCompararatorEnum theComparator, double theValue, String theUnits) { - myDoseQuantity = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for doseQuantity (Amount of vaccine administered) - * - *

- * Definition: - * The quantity of vaccine product that was administered - *

- */ - public Immunization setDoseQuantity( QuantityCompararatorEnum theComparator, long theValue, String theUnits) { - myDoseQuantity = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for doseQuantity (Amount of vaccine administered) - * - *

- * Definition: - * The quantity of vaccine product that was administered - *

- */ - public Immunization setDoseQuantity( QuantityCompararatorEnum theComparator, double theValue, String theSystem, String theUnits) { - myDoseQuantity = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for doseQuantity (Amount of vaccine administered) - * - *

- * Definition: - * The quantity of vaccine product that was administered - *

- */ - public Immunization setDoseQuantity( QuantityCompararatorEnum theComparator, long theValue, String theSystem, String theUnits) { - myDoseQuantity = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for doseQuantity (Amount of vaccine administered) - * - *

- * Definition: - * The quantity of vaccine product that was administered - *

- */ - public Immunization setDoseQuantity( double theValue) { - myDoseQuantity = new QuantityDt(theValue); - return this; - } - - /** - * Sets the value for doseQuantity (Amount of vaccine administered) - * - *

- * Definition: - * The quantity of vaccine product that was administered - *

- */ - public Immunization setDoseQuantity( long theValue) { - myDoseQuantity = new QuantityDt(theValue); - return this; - } - - - /** - * Gets the value(s) for explanation (Administration / refusal reasons). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Reasons why a vaccine was administered or refused - *

- */ - public Explanation getExplanation() { - if (myExplanation == null) { - myExplanation = new Explanation(); - } - return myExplanation; - } - - /** - * Sets the value(s) for explanation (Administration / refusal reasons) - * - *

- * Definition: - * Reasons why a vaccine was administered or refused - *

- */ - public Immunization setExplanation(Explanation theValue) { - myExplanation = theValue; - return this; - } - - - /** - * Gets the value(s) for reaction (Details of a reaction that follows immunization). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Categorical data indicating that an adverse event is associated in time to an immunization - *

- */ - public java.util.List getReaction() { - if (myReaction == null) { - myReaction = new java.util.ArrayList(); - } - return myReaction; - } - - /** - * Sets the value(s) for reaction (Details of a reaction that follows immunization) - * - *

- * Definition: - * Categorical data indicating that an adverse event is associated in time to an immunization - *

- */ - public Immunization setReaction(java.util.List theValue) { - myReaction = theValue; - return this; - } - - /** - * Adds and returns a new value for reaction (Details of a reaction that follows immunization) - * - *

- * Definition: - * Categorical data indicating that an adverse event is associated in time to an immunization - *

- */ - public Reaction addReaction() { - Reaction newType = new Reaction(); - getReaction().add(newType); - return newType; - } - - /** - * Gets the first repetition for reaction (Details of a reaction that follows immunization), - * creating it if it does not already exist. - * - *

- * Definition: - * Categorical data indicating that an adverse event is associated in time to an immunization - *

- */ - public Reaction getReactionFirstRep() { - if (getReaction().isEmpty()) { - return addReaction(); - } - return getReaction().get(0); - } - - /** - * Gets the value(s) for vaccinationProtocol (What protocol was followed). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Contains information about the protocol(s) under which the vaccine was administered - *

- */ - public java.util.List getVaccinationProtocol() { - if (myVaccinationProtocol == null) { - myVaccinationProtocol = new java.util.ArrayList(); - } - return myVaccinationProtocol; - } - - /** - * Sets the value(s) for vaccinationProtocol (What protocol was followed) - * - *

- * Definition: - * Contains information about the protocol(s) under which the vaccine was administered - *

- */ - public Immunization setVaccinationProtocol(java.util.List theValue) { - myVaccinationProtocol = theValue; - return this; - } - - /** - * Adds and returns a new value for vaccinationProtocol (What protocol was followed) - * - *

- * Definition: - * Contains information about the protocol(s) under which the vaccine was administered - *

- */ - public VaccinationProtocol addVaccinationProtocol() { - VaccinationProtocol newType = new VaccinationProtocol(); - getVaccinationProtocol().add(newType); - return newType; - } - - /** - * Gets the first repetition for vaccinationProtocol (What protocol was followed), - * creating it if it does not already exist. - * - *

- * Definition: - * Contains information about the protocol(s) under which the vaccine was administered - *

- */ - public VaccinationProtocol getVaccinationProtocolFirstRep() { - if (getVaccinationProtocol().isEmpty()) { - return addVaccinationProtocol(); - } - return getVaccinationProtocol().get(0); - } - - /** - * Block class for child element: Immunization.explanation (Administration / refusal reasons) - * - *

- * Definition: - * Reasons why a vaccine was administered or refused - *

- */ - @Block() - public static class Explanation extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="reason", type=CodeableConceptDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Why immunization occurred", - formalDefinition="Reasons why a vaccine was administered" - ) - private java.util.List> myReason; - - @Child(name="refusalReason", type=CodeableConceptDt.class, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Why immunization did not occur", - formalDefinition="Refusal or exemption reasons" - ) - private java.util.List myRefusalReason; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myReason, myRefusalReason); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myReason, myRefusalReason); - } - - /** - * Gets the value(s) for reason (Why immunization occurred). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Reasons why a vaccine was administered - *

- */ - public java.util.List> getReason() { - if (myReason == null) { - myReason = new java.util.ArrayList>(); - } - return myReason; - } - - /** - * Sets the value(s) for reason (Why immunization occurred) - * - *

- * Definition: - * Reasons why a vaccine was administered - *

- */ - public Explanation setReason(java.util.List> theValue) { - myReason = theValue; - return this; - } - - /** - * Add a value for reason (Why immunization occurred) 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: - * Reasons why a vaccine was administered - *

- */ - public BoundCodeableConceptDt addReason(ImmunizationReasonCodesEnum theValue) { - BoundCodeableConceptDt retVal = new BoundCodeableConceptDt(ImmunizationReasonCodesEnum.VALUESET_BINDER, theValue); - getReason().add(retVal); - return retVal; - } - - /** - * Gets the first repetition for reason (Why immunization occurred), - * creating it if it does not already exist. - * - *

- * Definition: - * Reasons why a vaccine was administered - *

- */ - public BoundCodeableConceptDt getReasonFirstRep() { - if (getReason().size() == 0) { - addReason(); - } - return getReason().get(0); - } - - /** - * Add a value for reason (Why immunization occurred) - * - *

- * Definition: - * Reasons why a vaccine was administered - *

- */ - public BoundCodeableConceptDt addReason() { - BoundCodeableConceptDt retVal = new BoundCodeableConceptDt(ImmunizationReasonCodesEnum.VALUESET_BINDER); - getReason().add(retVal); - return retVal; - } - - /** - * Sets the value(s), and clears any existing value(s) for reason (Why immunization occurred) - * - *

- * Definition: - * Reasons why a vaccine was administered - *

- */ - public Explanation setReason(ImmunizationReasonCodesEnum theValue) { - getReason().clear(); - addReason(theValue); - return this; - } - - - /** - * Gets the value(s) for refusalReason (Why immunization did not occur). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Refusal or exemption reasons - *

- */ - public java.util.List getRefusalReason() { - if (myRefusalReason == null) { - myRefusalReason = new java.util.ArrayList(); - } - return myRefusalReason; - } - - /** - * Sets the value(s) for refusalReason (Why immunization did not occur) - * - *

- * Definition: - * Refusal or exemption reasons - *

- */ - public Explanation setRefusalReason(java.util.List theValue) { - myRefusalReason = theValue; - return this; - } - - /** - * Adds and returns a new value for refusalReason (Why immunization did not occur) - * - *

- * Definition: - * Refusal or exemption reasons - *

- */ - public CodeableConceptDt addRefusalReason() { - CodeableConceptDt newType = new CodeableConceptDt(); - getRefusalReason().add(newType); - return newType; - } - - /** - * Gets the first repetition for refusalReason (Why immunization did not occur), - * creating it if it does not already exist. - * - *

- * Definition: - * Refusal or exemption reasons - *

- */ - public CodeableConceptDt getRefusalReasonFirstRep() { - if (getRefusalReason().isEmpty()) { - return addRefusalReason(); - } - return getRefusalReason().get(0); - } - - - } - - - /** - * Block class for child element: Immunization.reaction (Details of a reaction that follows immunization) - * - *

- * Definition: - * Categorical data indicating that an adverse event is associated in time to an immunization - *

- */ - @Block() - public static class Reaction extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="date", type=DateTimeDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="When did reaction start?", - formalDefinition="Date of reaction to the immunization" - ) - private DateTimeDt myDate; - - @Child(name="detail", order=1, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.AdverseReaction.class, ca.uhn.fhir.model.dstu.resource.Observation.class }) - @Description( - shortDefinition="Additional information on reaction", - formalDefinition="Details of the reaction" - ) - private ResourceReferenceDt myDetail; - - @Child(name="reported", type=BooleanDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Was reaction self-reported?", - formalDefinition="Self-reported indicator" - ) - private BooleanDt myReported; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myDate, myDetail, myReported); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myDate, myDetail, myReported); - } - - /** - * Gets the value(s) for date (When did reaction start?). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Date of reaction to the immunization - *

- */ - public DateTimeDt getDate() { - if (myDate == null) { - myDate = new DateTimeDt(); - } - return myDate; - } - - /** - * Sets the value(s) for date (When did reaction start?) - * - *

- * Definition: - * Date of reaction to the immunization - *

- */ - public Reaction setDate(DateTimeDt theValue) { - myDate = theValue; - return this; - } - - /** - * Sets the value for date (When did reaction start?) - * - *

- * Definition: - * Date of reaction to the immunization - *

- */ - public Reaction setDateWithSecondsPrecision( Date theDate) { - myDate = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for date (When did reaction start?) - * - *

- * Definition: - * Date of reaction to the immunization - *

- */ - public Reaction setDate( Date theDate, TemporalPrecisionEnum thePrecision) { - myDate = new DateTimeDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for detail (Additional information on reaction). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Details of the reaction - *

- */ - public ResourceReferenceDt getDetail() { - if (myDetail == null) { - myDetail = new ResourceReferenceDt(); - } - return myDetail; - } - - /** - * Sets the value(s) for detail (Additional information on reaction) - * - *

- * Definition: - * Details of the reaction - *

- */ - public Reaction setDetail(ResourceReferenceDt theValue) { - myDetail = theValue; - return this; - } - - - /** - * Gets the value(s) for reported (Was reaction self-reported?). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Self-reported indicator - *

- */ - public BooleanDt getReported() { - if (myReported == null) { - myReported = new BooleanDt(); - } - return myReported; - } - - /** - * Sets the value(s) for reported (Was reaction self-reported?) - * - *

- * Definition: - * Self-reported indicator - *

- */ - public Reaction setReported(BooleanDt theValue) { - myReported = theValue; - return this; - } - - /** - * Sets the value for reported (Was reaction self-reported?) - * - *

- * Definition: - * Self-reported indicator - *

- */ - public Reaction setReported( boolean theBoolean) { - myReported = new BooleanDt(theBoolean); - return this; - } - - - - } - - - /** - * Block class for child element: Immunization.vaccinationProtocol (What protocol was followed) - * - *

- * Definition: - * Contains information about the protocol(s) under which the vaccine was administered - *

- */ - @Block() - public static class VaccinationProtocol extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="doseSequence", type=IntegerDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="What dose number within series?", - formalDefinition="Nominal position in a series" - ) - private IntegerDt myDoseSequence; - - @Child(name="description", type=StringDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Details of vaccine protocol", - formalDefinition="Contains the description about the protocol under which the vaccine was administered" - ) - private StringDt myDescription; - - @Child(name="authority", order=2, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Organization.class }) - @Description( - shortDefinition="Who is responsible for protocol", - formalDefinition="Indicates the authority who published the protocol? E.g. ACIP" - ) - private ResourceReferenceDt myAuthority; - - @Child(name="series", type=StringDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Name of vaccine series", - formalDefinition="One possible path to achieve presumed immunity against a disease - within the context of an authority" - ) - private StringDt mySeries; - - @Child(name="seriesDoses", type=IntegerDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="Recommended number of doses for immunity", - formalDefinition="The recommended number of doses to achieve immunity." - ) - private IntegerDt mySeriesDoses; - - @Child(name="doseTarget", type=CodeableConceptDt.class, order=5, min=1, max=1) - @Description( - shortDefinition="Disease immunized against", - formalDefinition="The targeted disease" - ) - private CodeableConceptDt myDoseTarget; - - @Child(name="doseStatus", type=CodeableConceptDt.class, order=6, min=1, max=1) - @Description( - shortDefinition="Does dose count towards immunity?", - formalDefinition="Indicates if the immunization event should \"count\" against the protocol." - ) - private CodeableConceptDt myDoseStatus; - - @Child(name="doseStatusReason", type=CodeableConceptDt.class, order=7, min=0, max=1) - @Description( - shortDefinition="Why does does count/not count?", - formalDefinition="Provides an explanation as to why a immunization event should or should not count against the protocol." - ) - private CodeableConceptDt myDoseStatusReason; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myDoseSequence, myDescription, myAuthority, mySeries, mySeriesDoses, myDoseTarget, myDoseStatus, myDoseStatusReason); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myDoseSequence, myDescription, myAuthority, mySeries, mySeriesDoses, myDoseTarget, myDoseStatus, myDoseStatusReason); - } - - /** - * Gets the value(s) for doseSequence (What dose number within series?). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Nominal position in a series - *

- */ - public IntegerDt getDoseSequence() { - if (myDoseSequence == null) { - myDoseSequence = new IntegerDt(); - } - return myDoseSequence; - } - - /** - * Sets the value(s) for doseSequence (What dose number within series?) - * - *

- * Definition: - * Nominal position in a series - *

- */ - public VaccinationProtocol setDoseSequence(IntegerDt theValue) { - myDoseSequence = theValue; - return this; - } - - /** - * Sets the value for doseSequence (What dose number within series?) - * - *

- * Definition: - * Nominal position in a series - *

- */ - public VaccinationProtocol setDoseSequence( int theInteger) { - myDoseSequence = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for description (Details of vaccine protocol). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Contains the description about the protocol under which the vaccine was administered - *

- */ - public StringDt getDescription() { - if (myDescription == null) { - myDescription = new StringDt(); - } - return myDescription; - } - - /** - * Sets the value(s) for description (Details of vaccine protocol) - * - *

- * Definition: - * Contains the description about the protocol under which the vaccine was administered - *

- */ - public VaccinationProtocol setDescription(StringDt theValue) { - myDescription = theValue; - return this; - } - - /** - * Sets the value for description (Details of vaccine protocol) - * - *

- * Definition: - * Contains the description about the protocol under which the vaccine was administered - *

- */ - public VaccinationProtocol setDescription( String theString) { - myDescription = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for authority (Who is responsible for protocol). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates the authority who published the protocol? E.g. ACIP - *

- */ - public ResourceReferenceDt getAuthority() { - if (myAuthority == null) { - myAuthority = new ResourceReferenceDt(); - } - return myAuthority; - } - - /** - * Sets the value(s) for authority (Who is responsible for protocol) - * - *

- * Definition: - * Indicates the authority who published the protocol? E.g. ACIP - *

- */ - public VaccinationProtocol setAuthority(ResourceReferenceDt theValue) { - myAuthority = theValue; - return this; - } - - - /** - * Gets the value(s) for series (Name of vaccine series). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * One possible path to achieve presumed immunity against a disease - within the context of an authority - *

- */ - public StringDt getSeries() { - if (mySeries == null) { - mySeries = new StringDt(); - } - return mySeries; - } - - /** - * Sets the value(s) for series (Name of vaccine series) - * - *

- * Definition: - * One possible path to achieve presumed immunity against a disease - within the context of an authority - *

- */ - public VaccinationProtocol setSeries(StringDt theValue) { - mySeries = theValue; - return this; - } - - /** - * Sets the value for series (Name of vaccine series) - * - *

- * Definition: - * One possible path to achieve presumed immunity against a disease - within the context of an authority - *

- */ - public VaccinationProtocol setSeries( String theString) { - mySeries = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for seriesDoses (Recommended number of doses for immunity). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The recommended number of doses to achieve immunity. - *

- */ - public IntegerDt getSeriesDoses() { - if (mySeriesDoses == null) { - mySeriesDoses = new IntegerDt(); - } - return mySeriesDoses; - } - - /** - * Sets the value(s) for seriesDoses (Recommended number of doses for immunity) - * - *

- * Definition: - * The recommended number of doses to achieve immunity. - *

- */ - public VaccinationProtocol setSeriesDoses(IntegerDt theValue) { - mySeriesDoses = theValue; - return this; - } - - /** - * Sets the value for seriesDoses (Recommended number of doses for immunity) - * - *

- * Definition: - * The recommended number of doses to achieve immunity. - *

- */ - public VaccinationProtocol setSeriesDoses( int theInteger) { - mySeriesDoses = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for doseTarget (Disease immunized against). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The targeted disease - *

- */ - public CodeableConceptDt getDoseTarget() { - if (myDoseTarget == null) { - myDoseTarget = new CodeableConceptDt(); - } - return myDoseTarget; - } - - /** - * Sets the value(s) for doseTarget (Disease immunized against) - * - *

- * Definition: - * The targeted disease - *

- */ - public VaccinationProtocol setDoseTarget(CodeableConceptDt theValue) { - myDoseTarget = theValue; - return this; - } - - - /** - * Gets the value(s) for doseStatus (Does dose count towards immunity?). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates if the immunization event should \"count\" against the protocol. - *

- */ - public CodeableConceptDt getDoseStatus() { - if (myDoseStatus == null) { - myDoseStatus = new CodeableConceptDt(); - } - return myDoseStatus; - } - - /** - * Sets the value(s) for doseStatus (Does dose count towards immunity?) - * - *

- * Definition: - * Indicates if the immunization event should \"count\" against the protocol. - *

- */ - public VaccinationProtocol setDoseStatus(CodeableConceptDt theValue) { - myDoseStatus = theValue; - return this; - } - - - /** - * Gets the value(s) for doseStatusReason (Why does does count/not count?). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Provides an explanation as to why a immunization event should or should not count against the protocol. - *

- */ - public CodeableConceptDt getDoseStatusReason() { - if (myDoseStatusReason == null) { - myDoseStatusReason = new CodeableConceptDt(); - } - return myDoseStatusReason; - } - - /** - * Sets the value(s) for doseStatusReason (Why does does count/not count?) - * - *

- * Definition: - * Provides an explanation as to why a immunization event should or should not count against the protocol. - *

- */ - public VaccinationProtocol setDoseStatusReason(CodeableConceptDt theValue) { - myDoseStatusReason = theValue; - return this; - } - - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ImmunizationRecommendation.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ImmunizationRecommendation.java deleted file mode 100644 index 69db89d2d24..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ImmunizationRecommendation.java +++ /dev/null @@ -1,1322 +0,0 @@ - - - - - - - - - - - - - - - - -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.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.ImmunizationRecommendationDateCriterionCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.ImmunizationRecommendationStatusCodesEnum; -import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; -import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.rest.gclient.DateClientParam; -import ca.uhn.fhir.rest.gclient.NumberClientParam; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR ImmunizationRecommendation Resource - * (Immunization profile) - * - *

- * Definition: - * A patient's point-of-time immunization status and recommendation with optional supporting justification - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/ImmunizationRecommendation - *

- * - */ -@ResourceDef(name="ImmunizationRecommendation", profile="http://hl7.org/fhir/profiles/ImmunizationRecommendation", id="immunizationrecommendation") -public class ImmunizationRecommendation extends BaseResource implements IResource { - - /** - * Search parameter constant for subject - *

- * Description:
- * Type: reference
- * Path: ImmunizationRecommendation.subject
- *

- */ - @SearchParamDefinition(name="subject", path="ImmunizationRecommendation.subject", description="", type="reference" ) - public static final String SP_SUBJECT = "subject"; - - /** - * Fluent Client search parameter constant for subject - *

- * Description:
- * Type: reference
- * Path: ImmunizationRecommendation.subject
- *

- */ - public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ImmunizationRecommendation.subject". - */ - public static final Include INCLUDE_SUBJECT = new Include("ImmunizationRecommendation.subject"); - - /** - * Search parameter constant for vaccine-type - *

- * Description:
- * Type: token
- * Path: ImmunizationRecommendation.recommendation.vaccineType
- *

- */ - @SearchParamDefinition(name="vaccine-type", path="ImmunizationRecommendation.recommendation.vaccineType", description="", type="token" ) - public static final String SP_VACCINE_TYPE = "vaccine-type"; - - /** - * Fluent Client search parameter constant for vaccine-type - *

- * Description:
- * Type: token
- * Path: ImmunizationRecommendation.recommendation.vaccineType
- *

- */ - public static final TokenClientParam VACCINE_TYPE = new TokenClientParam(SP_VACCINE_TYPE); - - /** - * Search parameter constant for identifier - *

- * Description:
- * Type: token
- * Path: ImmunizationRecommendation.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="ImmunizationRecommendation.identifier", description="", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - - /** - * Fluent Client search parameter constant for identifier - *

- * Description:
- * Type: token
- * Path: ImmunizationRecommendation.identifier
- *

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

- * Description:
- * Type: date
- * Path: ImmunizationRecommendation.recommendation.date
- *

- */ - @SearchParamDefinition(name="date", path="ImmunizationRecommendation.recommendation.date", description="", type="date" ) - public static final String SP_DATE = "date"; - - /** - * Fluent Client search parameter constant for date - *

- * Description:
- * Type: date
- * Path: ImmunizationRecommendation.recommendation.date
- *

- */ - public static final DateClientParam DATE = new DateClientParam(SP_DATE); - - /** - * Search parameter constant for dose-number - *

- * Description:
- * Type: number
- * Path: ImmunizationRecommendation.recommendation.doseNumber
- *

- */ - @SearchParamDefinition(name="dose-number", path="ImmunizationRecommendation.recommendation.doseNumber", description="", type="number" ) - public static final String SP_DOSE_NUMBER = "dose-number"; - - /** - * Fluent Client search parameter constant for dose-number - *

- * Description:
- * Type: number
- * Path: ImmunizationRecommendation.recommendation.doseNumber
- *

- */ - public static final NumberClientParam DOSE_NUMBER = new NumberClientParam(SP_DOSE_NUMBER); - - /** - * Search parameter constant for status - *

- * Description:
- * Type: token
- * Path: ImmunizationRecommendation.recommendation.forecastStatus
- *

- */ - @SearchParamDefinition(name="status", path="ImmunizationRecommendation.recommendation.forecastStatus", description="", type="token" ) - public static final String SP_STATUS = "status"; - - /** - * Fluent Client search parameter constant for status - *

- * Description:
- * Type: token
- * Path: ImmunizationRecommendation.recommendation.forecastStatus
- *

- */ - public static final TokenClientParam STATUS = new TokenClientParam(SP_STATUS); - - /** - * Search parameter constant for dose-sequence - *

- * Description:
- * Type: token
- * Path: ImmunizationRecommendation.recommendation.protocol.doseSequence
- *

- */ - @SearchParamDefinition(name="dose-sequence", path="ImmunizationRecommendation.recommendation.protocol.doseSequence", description="", type="token" ) - public static final String SP_DOSE_SEQUENCE = "dose-sequence"; - - /** - * Fluent Client search parameter constant for dose-sequence - *

- * Description:
- * Type: token
- * Path: ImmunizationRecommendation.recommendation.protocol.doseSequence
- *

- */ - public static final TokenClientParam DOSE_SEQUENCE = new TokenClientParam(SP_DOSE_SEQUENCE); - - /** - * Search parameter constant for support - *

- * Description:
- * Type: reference
- * Path: ImmunizationRecommendation.recommendation.supportingImmunization
- *

- */ - @SearchParamDefinition(name="support", path="ImmunizationRecommendation.recommendation.supportingImmunization", description="", type="reference" ) - public static final String SP_SUPPORT = "support"; - - /** - * Fluent Client search parameter constant for support - *

- * Description:
- * Type: reference
- * Path: ImmunizationRecommendation.recommendation.supportingImmunization
- *

- */ - public static final ReferenceClientParam SUPPORT = new ReferenceClientParam(SP_SUPPORT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ImmunizationRecommendation.recommendation.supportingImmunization". - */ - public static final Include INCLUDE_RECOMMENDATION_SUPPORTINGIMMUNIZATION = new Include("ImmunizationRecommendation.recommendation.supportingImmunization"); - - /** - * Search parameter constant for information - *

- * Description:
- * Type: reference
- * Path: ImmunizationRecommendation.recommendation.supportingPatientInformation
- *

- */ - @SearchParamDefinition(name="information", path="ImmunizationRecommendation.recommendation.supportingPatientInformation", description="", type="reference" ) - public static final String SP_INFORMATION = "information"; - - /** - * Fluent Client search parameter constant for information - *

- * Description:
- * Type: reference
- * Path: ImmunizationRecommendation.recommendation.supportingPatientInformation
- *

- */ - public static final ReferenceClientParam INFORMATION = new ReferenceClientParam(SP_INFORMATION); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ImmunizationRecommendation.recommendation.supportingPatientInformation". - */ - public static final Include INCLUDE_RECOMMENDATION_SUPPORTINGPATIENTINFORMATION = new Include("ImmunizationRecommendation.recommendation.supportingPatientInformation"); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Business identifier", - formalDefinition="A unique identifier assigned to this particular recommendation record." - ) - private java.util.List myIdentifier; - - @Child(name="subject", order=1, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="Who this profile is for", - formalDefinition="The patient who is the subject of the profile" - ) - private ResourceReferenceDt mySubject; - - @Child(name="recommendation", order=2, min=1, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Vaccine administration recommendations", - formalDefinition="Vaccine administration recommendations" - ) - private java.util.List myRecommendation; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, mySubject, myRecommendation); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, mySubject, myRecommendation); - } - - /** - * Gets the value(s) for identifier (Business identifier). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A unique identifier assigned to this particular recommendation record. - *

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Business identifier) - * - *

- * Definition: - * A unique identifier assigned to this particular recommendation record. - *

- */ - public ImmunizationRecommendation setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (Business identifier) - * - *

- * Definition: - * A unique identifier assigned to this particular recommendation record. - *

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (Business identifier), - * creating it if it does not already exist. - * - *

- * Definition: - * A unique identifier assigned to this particular recommendation record. - *

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (Business identifier) - * - *

- * Definition: - * A unique identifier assigned to this particular recommendation record. - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public ImmunizationRecommendation addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (Business identifier) - * - *

- * Definition: - * A unique identifier assigned to this particular recommendation record. - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public ImmunizationRecommendation addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for subject (Who this profile is for). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The patient who is the subject of the profile - *

- */ - public ResourceReferenceDt getSubject() { - if (mySubject == null) { - mySubject = new ResourceReferenceDt(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (Who this profile is for) - * - *

- * Definition: - * The patient who is the subject of the profile - *

- */ - public ImmunizationRecommendation setSubject(ResourceReferenceDt theValue) { - mySubject = theValue; - return this; - } - - - /** - * Gets the value(s) for recommendation (Vaccine administration recommendations). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Vaccine administration recommendations - *

- */ - public java.util.List getRecommendation() { - if (myRecommendation == null) { - myRecommendation = new java.util.ArrayList(); - } - return myRecommendation; - } - - /** - * Sets the value(s) for recommendation (Vaccine administration recommendations) - * - *

- * Definition: - * Vaccine administration recommendations - *

- */ - public ImmunizationRecommendation setRecommendation(java.util.List theValue) { - myRecommendation = theValue; - return this; - } - - /** - * Adds and returns a new value for recommendation (Vaccine administration recommendations) - * - *

- * Definition: - * Vaccine administration recommendations - *

- */ - public Recommendation addRecommendation() { - Recommendation newType = new Recommendation(); - getRecommendation().add(newType); - return newType; - } - - /** - * Gets the first repetition for recommendation (Vaccine administration recommendations), - * creating it if it does not already exist. - * - *

- * Definition: - * Vaccine administration recommendations - *

- */ - public Recommendation getRecommendationFirstRep() { - if (getRecommendation().isEmpty()) { - return addRecommendation(); - } - return getRecommendation().get(0); - } - - /** - * Block class for child element: ImmunizationRecommendation.recommendation (Vaccine administration recommendations) - * - *

- * Definition: - * Vaccine administration recommendations - *

- */ - @Block() - public static class Recommendation extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="date", type=DateTimeDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Date recommendation created", - formalDefinition="The date the immunization recommendation was created." - ) - private DateTimeDt myDate; - - @Child(name="vaccineType", type=CodeableConceptDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="Vaccine recommendation applies to", - formalDefinition="Vaccine that pertains to the recommendation" - ) - private CodeableConceptDt myVaccineType; - - @Child(name="doseNumber", type=IntegerDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Recommended dose number", - formalDefinition="This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose)." - ) - private IntegerDt myDoseNumber; - - @Child(name="forecastStatus", type=CodeableConceptDt.class, order=3, min=1, max=1) - @Description( - shortDefinition="Vaccine administration status", - formalDefinition="Vaccine administration status" - ) - private BoundCodeableConceptDt myForecastStatus; - - @Child(name="dateCriterion", order=4, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Dates governing proposed immunization", - formalDefinition="Vaccine date recommendations - e.g. earliest date to administer, latest date to administer, etc." - ) - private java.util.List myDateCriterion; - - @Child(name="protocol", order=5, min=0, max=1) - @Description( - shortDefinition="Protocol used by recommendation", - formalDefinition="Contains information about the protocol under which the vaccine was administered" - ) - private RecommendationProtocol myProtocol; - - @Child(name="supportingImmunization", order=6, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Immunization.class }) - @Description( - shortDefinition="Past immunizations supporting recommendation", - formalDefinition="Immunization event history that supports the status and recommendation" - ) - private java.util.List mySupportingImmunization; - - @Child(name="supportingPatientInformation", order=7, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Observation.class, ca.uhn.fhir.model.dstu.resource.AdverseReaction.class, ca.uhn.fhir.model.dstu.resource.AllergyIntolerance.class }) - @Description( - shortDefinition="Patient observations supporting recommendation", - formalDefinition="Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information." - ) - private java.util.List mySupportingPatientInformation; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myDate, myVaccineType, myDoseNumber, myForecastStatus, myDateCriterion, myProtocol, mySupportingImmunization, mySupportingPatientInformation); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myDate, myVaccineType, myDoseNumber, myForecastStatus, myDateCriterion, myProtocol, mySupportingImmunization, mySupportingPatientInformation); - } - - /** - * Gets the value(s) for date (Date recommendation created). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The date the immunization recommendation was created. - *

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

- * Definition: - * The date the immunization recommendation was created. - *

- */ - public Recommendation setDate(DateTimeDt theValue) { - myDate = theValue; - return this; - } - - /** - * Sets the value for date (Date recommendation created) - * - *

- * Definition: - * The date the immunization recommendation was created. - *

- */ - public Recommendation setDateWithSecondsPrecision( Date theDate) { - myDate = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for date (Date recommendation created) - * - *

- * Definition: - * The date the immunization recommendation was created. - *

- */ - public Recommendation setDate( Date theDate, TemporalPrecisionEnum thePrecision) { - myDate = new DateTimeDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for vaccineType (Vaccine recommendation applies to). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Vaccine that pertains to the recommendation - *

- */ - public CodeableConceptDt getVaccineType() { - if (myVaccineType == null) { - myVaccineType = new CodeableConceptDt(); - } - return myVaccineType; - } - - /** - * Sets the value(s) for vaccineType (Vaccine recommendation applies to) - * - *

- * Definition: - * Vaccine that pertains to the recommendation - *

- */ - public Recommendation setVaccineType(CodeableConceptDt theValue) { - myVaccineType = theValue; - return this; - } - - - /** - * Gets the value(s) for doseNumber (Recommended dose number). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose). - *

- */ - public IntegerDt getDoseNumber() { - if (myDoseNumber == null) { - myDoseNumber = new IntegerDt(); - } - return myDoseNumber; - } - - /** - * Sets the value(s) for doseNumber (Recommended dose number) - * - *

- * Definition: - * This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose). - *

- */ - public Recommendation setDoseNumber(IntegerDt theValue) { - myDoseNumber = theValue; - return this; - } - - /** - * Sets the value for doseNumber (Recommended dose number) - * - *

- * Definition: - * This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose). - *

- */ - public Recommendation setDoseNumber( int theInteger) { - myDoseNumber = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for forecastStatus (Vaccine administration status). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Vaccine administration status - *

- */ - public BoundCodeableConceptDt getForecastStatus() { - if (myForecastStatus == null) { - myForecastStatus = new BoundCodeableConceptDt(ImmunizationRecommendationStatusCodesEnum.VALUESET_BINDER); - } - return myForecastStatus; - } - - /** - * Sets the value(s) for forecastStatus (Vaccine administration status) - * - *

- * Definition: - * Vaccine administration status - *

- */ - public Recommendation setForecastStatus(BoundCodeableConceptDt theValue) { - myForecastStatus = theValue; - return this; - } - - /** - * Sets the value(s) for forecastStatus (Vaccine administration status) - * - *

- * Definition: - * Vaccine administration status - *

- */ - public Recommendation setForecastStatus(ImmunizationRecommendationStatusCodesEnum theValue) { - getForecastStatus().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for dateCriterion (Dates governing proposed immunization). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Vaccine date recommendations - e.g. earliest date to administer, latest date to administer, etc. - *

- */ - public java.util.List getDateCriterion() { - if (myDateCriterion == null) { - myDateCriterion = new java.util.ArrayList(); - } - return myDateCriterion; - } - - /** - * Sets the value(s) for dateCriterion (Dates governing proposed immunization) - * - *

- * Definition: - * Vaccine date recommendations - e.g. earliest date to administer, latest date to administer, etc. - *

- */ - public Recommendation setDateCriterion(java.util.List theValue) { - myDateCriterion = theValue; - return this; - } - - /** - * Adds and returns a new value for dateCriterion (Dates governing proposed immunization) - * - *

- * Definition: - * Vaccine date recommendations - e.g. earliest date to administer, latest date to administer, etc. - *

- */ - public RecommendationDateCriterion addDateCriterion() { - RecommendationDateCriterion newType = new RecommendationDateCriterion(); - getDateCriterion().add(newType); - return newType; - } - - /** - * Gets the first repetition for dateCriterion (Dates governing proposed immunization), - * creating it if it does not already exist. - * - *

- * Definition: - * Vaccine date recommendations - e.g. earliest date to administer, latest date to administer, etc. - *

- */ - public RecommendationDateCriterion getDateCriterionFirstRep() { - if (getDateCriterion().isEmpty()) { - return addDateCriterion(); - } - return getDateCriterion().get(0); - } - - /** - * Gets the value(s) for protocol (Protocol used by recommendation). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Contains information about the protocol under which the vaccine was administered - *

- */ - public RecommendationProtocol getProtocol() { - if (myProtocol == null) { - myProtocol = new RecommendationProtocol(); - } - return myProtocol; - } - - /** - * Sets the value(s) for protocol (Protocol used by recommendation) - * - *

- * Definition: - * Contains information about the protocol under which the vaccine was administered - *

- */ - public Recommendation setProtocol(RecommendationProtocol theValue) { - myProtocol = theValue; - return this; - } - - - /** - * Gets the value(s) for supportingImmunization (Past immunizations supporting recommendation). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Immunization event history that supports the status and recommendation - *

- */ - public java.util.List getSupportingImmunization() { - if (mySupportingImmunization == null) { - mySupportingImmunization = new java.util.ArrayList(); - } - return mySupportingImmunization; - } - - /** - * Sets the value(s) for supportingImmunization (Past immunizations supporting recommendation) - * - *

- * Definition: - * Immunization event history that supports the status and recommendation - *

- */ - public Recommendation setSupportingImmunization(java.util.List theValue) { - mySupportingImmunization = theValue; - return this; - } - - /** - * Adds and returns a new value for supportingImmunization (Past immunizations supporting recommendation) - * - *

- * Definition: - * Immunization event history that supports the status and recommendation - *

- */ - public ResourceReferenceDt addSupportingImmunization() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getSupportingImmunization().add(newType); - return newType; - } - - /** - * Gets the value(s) for supportingPatientInformation (Patient observations supporting recommendation). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information. - *

- */ - public java.util.List getSupportingPatientInformation() { - if (mySupportingPatientInformation == null) { - mySupportingPatientInformation = new java.util.ArrayList(); - } - return mySupportingPatientInformation; - } - - /** - * Sets the value(s) for supportingPatientInformation (Patient observations supporting recommendation) - * - *

- * Definition: - * Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information. - *

- */ - public Recommendation setSupportingPatientInformation(java.util.List theValue) { - mySupportingPatientInformation = theValue; - return this; - } - - /** - * Adds and returns a new value for supportingPatientInformation (Patient observations supporting recommendation) - * - *

- * Definition: - * Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information. - *

- */ - public ResourceReferenceDt addSupportingPatientInformation() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getSupportingPatientInformation().add(newType); - return newType; - } - - - } - - /** - * Block class for child element: ImmunizationRecommendation.recommendation.dateCriterion (Dates governing proposed immunization) - * - *

- * Definition: - * Vaccine date recommendations - e.g. earliest date to administer, latest date to administer, etc. - *

- */ - @Block() - public static class RecommendationDateCriterion extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="code", type=CodeableConceptDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Type of date", - formalDefinition="Date classification of recommendation - e.g. earliest date to give, latest date to give, etc." - ) - private BoundCodeableConceptDt myCode; - - @Child(name="value", type=DateTimeDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="Recommended date", - formalDefinition="Date recommendation" - ) - private DateTimeDt myValue; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCode, myValue); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCode, myValue); - } - - /** - * Gets the value(s) for code (Type of date). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Date classification of recommendation - e.g. earliest date to give, latest date to give, etc. - *

- */ - public BoundCodeableConceptDt getCode() { - if (myCode == null) { - myCode = new BoundCodeableConceptDt(ImmunizationRecommendationDateCriterionCodesEnum.VALUESET_BINDER); - } - return myCode; - } - - /** - * Sets the value(s) for code (Type of date) - * - *

- * Definition: - * Date classification of recommendation - e.g. earliest date to give, latest date to give, etc. - *

- */ - public RecommendationDateCriterion setCode(BoundCodeableConceptDt theValue) { - myCode = theValue; - return this; - } - - /** - * Sets the value(s) for code (Type of date) - * - *

- * Definition: - * Date classification of recommendation - e.g. earliest date to give, latest date to give, etc. - *

- */ - public RecommendationDateCriterion setCode(ImmunizationRecommendationDateCriterionCodesEnum theValue) { - getCode().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for value (Recommended date). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Date recommendation - *

- */ - public DateTimeDt getValue() { - if (myValue == null) { - myValue = new DateTimeDt(); - } - return myValue; - } - - /** - * Sets the value(s) for value (Recommended date) - * - *

- * Definition: - * Date recommendation - *

- */ - public RecommendationDateCriterion setValue(DateTimeDt theValue) { - myValue = theValue; - return this; - } - - /** - * Sets the value for value (Recommended date) - * - *

- * Definition: - * Date recommendation - *

- */ - public RecommendationDateCriterion setValueWithSecondsPrecision( Date theDate) { - myValue = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for value (Recommended date) - * - *

- * Definition: - * Date recommendation - *

- */ - public RecommendationDateCriterion setValue( Date theDate, TemporalPrecisionEnum thePrecision) { - myValue = new DateTimeDt(theDate, thePrecision); - return this; - } - - - - } - - - /** - * Block class for child element: ImmunizationRecommendation.recommendation.protocol (Protocol used by recommendation) - * - *

- * Definition: - * Contains information about the protocol under which the vaccine was administered - *

- */ - @Block() - public static class RecommendationProtocol extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="doseSequence", type=IntegerDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Number of dose within sequence", - formalDefinition="Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol." - ) - private IntegerDt myDoseSequence; - - @Child(name="description", type=StringDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Protocol details", - formalDefinition="Contains the description about the protocol under which the vaccine was administered" - ) - private StringDt myDescription; - - @Child(name="authority", order=2, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Organization.class }) - @Description( - shortDefinition="Who is responsible for protocol", - formalDefinition="Indicates the authority who published the protocol? E.g. ACIP" - ) - private ResourceReferenceDt myAuthority; - - @Child(name="series", type=StringDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Name of vaccination series", - formalDefinition="One possible path to achieve presumed immunity against a disease - within the context of an authority" - ) - private StringDt mySeries; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myDoseSequence, myDescription, myAuthority, mySeries); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myDoseSequence, myDescription, myAuthority, mySeries); - } - - /** - * Gets the value(s) for doseSequence (Number of dose within sequence). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol. - *

- */ - public IntegerDt getDoseSequence() { - if (myDoseSequence == null) { - myDoseSequence = new IntegerDt(); - } - return myDoseSequence; - } - - /** - * Sets the value(s) for doseSequence (Number of dose within sequence) - * - *

- * Definition: - * Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol. - *

- */ - public RecommendationProtocol setDoseSequence(IntegerDt theValue) { - myDoseSequence = theValue; - return this; - } - - /** - * Sets the value for doseSequence (Number of dose within sequence) - * - *

- * Definition: - * Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol. - *

- */ - public RecommendationProtocol setDoseSequence( int theInteger) { - myDoseSequence = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for description (Protocol details). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Contains the description about the protocol under which the vaccine was administered - *

- */ - public StringDt getDescription() { - if (myDescription == null) { - myDescription = new StringDt(); - } - return myDescription; - } - - /** - * Sets the value(s) for description (Protocol details) - * - *

- * Definition: - * Contains the description about the protocol under which the vaccine was administered - *

- */ - public RecommendationProtocol setDescription(StringDt theValue) { - myDescription = theValue; - return this; - } - - /** - * Sets the value for description (Protocol details) - * - *

- * Definition: - * Contains the description about the protocol under which the vaccine was administered - *

- */ - public RecommendationProtocol setDescription( String theString) { - myDescription = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for authority (Who is responsible for protocol). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates the authority who published the protocol? E.g. ACIP - *

- */ - public ResourceReferenceDt getAuthority() { - if (myAuthority == null) { - myAuthority = new ResourceReferenceDt(); - } - return myAuthority; - } - - /** - * Sets the value(s) for authority (Who is responsible for protocol) - * - *

- * Definition: - * Indicates the authority who published the protocol? E.g. ACIP - *

- */ - public RecommendationProtocol setAuthority(ResourceReferenceDt theValue) { - myAuthority = theValue; - return this; - } - - - /** - * Gets the value(s) for series (Name of vaccination series). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * One possible path to achieve presumed immunity against a disease - within the context of an authority - *

- */ - public StringDt getSeries() { - if (mySeries == null) { - mySeries = new StringDt(); - } - return mySeries; - } - - /** - * Sets the value(s) for series (Name of vaccination series) - * - *

- * Definition: - * One possible path to achieve presumed immunity against a disease - within the context of an authority - *

- */ - public RecommendationProtocol setSeries(StringDt theValue) { - mySeries = theValue; - return this; - } - - /** - * Sets the value for series (Name of vaccination series) - * - *

- * Definition: - * One possible path to achieve presumed immunity against a disease - within the context of an authority - *

- */ - public RecommendationProtocol setSeries( String theString) { - mySeries = new StringDt(theString); - return this; - } - - - - } - - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ListResource.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ListResource.java deleted file mode 100644 index af520332ec5..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ListResource.java +++ /dev/null @@ -1,987 +0,0 @@ - - - - - - - - - - - - - - - - -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.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.ListModeEnum; -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.rest.gclient.DateClientParam; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR List Resource - * (Information summarized from a list of other resources) - * - *

- * Definition: - * A set of information summarized from a list of other resources - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/List - *

- * - */ -@ResourceDef(name="List", profile="http://hl7.org/fhir/profiles/List", id="list") -public class ListResource extends BaseResource implements IResource { - - /** - * Search parameter constant for source - *

- * Description:
- * Type: reference
- * Path: List.source
- *

- */ - @SearchParamDefinition(name="source", path="List.source", description="", type="reference" ) - public static final String SP_SOURCE = "source"; - - /** - * Fluent Client search parameter constant for source - *

- * Description:
- * Type: reference
- * Path: List.source
- *

- */ - public static final ReferenceClientParam SOURCE = new ReferenceClientParam(SP_SOURCE); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "List.source". - */ - public static final Include INCLUDE_SOURCE = new Include("List.source"); - - /** - * Search parameter constant for item - *

- * Description:
- * Type: reference
- * Path: List.entry.item
- *

- */ - @SearchParamDefinition(name="item", path="List.entry.item", description="", type="reference" ) - public static final String SP_ITEM = "item"; - - /** - * Fluent Client search parameter constant for item - *

- * Description:
- * Type: reference
- * Path: List.entry.item
- *

- */ - public static final ReferenceClientParam ITEM = new ReferenceClientParam(SP_ITEM); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "List.entry.item". - */ - public static final Include INCLUDE_ENTRY_ITEM = new Include("List.entry.item"); - - /** - * Search parameter constant for empty-reason - *

- * Description:
- * Type: token
- * Path: List.emptyReason
- *

- */ - @SearchParamDefinition(name="empty-reason", path="List.emptyReason", description="", type="token" ) - public static final String SP_EMPTY_REASON = "empty-reason"; - - /** - * Fluent Client search parameter constant for empty-reason - *

- * Description:
- * Type: token
- * Path: List.emptyReason
- *

- */ - public static final TokenClientParam EMPTY_REASON = new TokenClientParam(SP_EMPTY_REASON); - - /** - * Search parameter constant for date - *

- * Description:
- * Type: date
- * Path: List.date
- *

- */ - @SearchParamDefinition(name="date", path="List.date", description="", type="date" ) - public static final String SP_DATE = "date"; - - /** - * Fluent Client search parameter constant for date - *

- * Description:
- * Type: date
- * Path: List.date
- *

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

- * Description:
- * Type: token
- * Path: List.code
- *

- */ - @SearchParamDefinition(name="code", path="List.code", description="", type="token" ) - public static final String SP_CODE = "code"; - - /** - * Fluent Client search parameter constant for code - *

- * Description:
- * Type: token
- * Path: List.code
- *

- */ - public static final TokenClientParam CODE = new TokenClientParam(SP_CODE); - - /** - * Search parameter constant for subject - *

- * Description:
- * Type: reference
- * Path: List.subject
- *

- */ - @SearchParamDefinition(name="subject", path="List.subject", description="", type="reference" ) - public static final String SP_SUBJECT = "subject"; - - /** - * Fluent Client search parameter constant for subject - *

- * Description:
- * Type: reference
- * Path: List.subject
- *

- */ - public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "List.subject". - */ - public static final Include INCLUDE_SUBJECT = new Include("List.subject"); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Business identifier", - formalDefinition="Identifier for the List assigned for business purposes outside the context of FHIR." - ) - private java.util.List myIdentifier; - - @Child(name="code", type=CodeableConceptDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="What the purpose of this list is", - formalDefinition="This code defines the purpose of the list - why it was created" - ) - private CodeableConceptDt myCode; - - @Child(name="subject", order=2, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.Group.class, ca.uhn.fhir.model.dstu.resource.Device.class, ca.uhn.fhir.model.dstu.resource.Location.class }) - @Description( - shortDefinition="If all resources have the same subject", - formalDefinition="The common subject (or patient) of the resources that are in the list, if there is one" - ) - private ResourceReferenceDt mySubject; - - @Child(name="source", order=3, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.Device.class }) - @Description( - shortDefinition="Who and/or what defined the list contents", - formalDefinition="The entity responsible for deciding what the contents of the list were" - ) - private ResourceReferenceDt mySource; - - @Child(name="date", type=DateTimeDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="When the list was prepared", - formalDefinition="The date that the list was prepared" - ) - private DateTimeDt myDate; - - @Child(name="ordered", type=BooleanDt.class, order=5, min=0, max=1) - @Description( - shortDefinition="Whether items in the list have a meaningful order", - formalDefinition="Whether items in the list have a meaningful order" - ) - private BooleanDt myOrdered; - - @Child(name="mode", type=CodeDt.class, order=6, min=1, max=1) - @Description( - shortDefinition="working | snapshot | changes", - formalDefinition="How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted" - ) - private BoundCodeDt myMode; - - @Child(name="entry", order=7, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Entries in the list", - formalDefinition="Entries in this list" - ) - private java.util.List myEntry; - - @Child(name="emptyReason", type=CodeableConceptDt.class, order=8, min=0, max=1) - @Description( - shortDefinition="Why list is empty", - formalDefinition="If the list is empty, why the list is empty" - ) - private CodeableConceptDt myEmptyReason; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myCode, mySubject, mySource, myDate, myOrdered, myMode, myEntry, myEmptyReason); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myCode, mySubject, mySource, myDate, myOrdered, myMode, myEntry, myEmptyReason); - } - - /** - * Gets the value(s) for identifier (Business identifier). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifier for the List assigned for business purposes outside the context of FHIR. - *

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Business identifier) - * - *

- * Definition: - * Identifier for the List assigned for business purposes outside the context of FHIR. - *

- */ - public ListResource setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (Business identifier) - * - *

- * Definition: - * Identifier for the List assigned for business purposes outside the context of FHIR. - *

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (Business identifier), - * creating it if it does not already exist. - * - *

- * Definition: - * Identifier for the List assigned for business purposes outside the context of FHIR. - *

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (Business identifier) - * - *

- * Definition: - * Identifier for the List assigned for business purposes outside the context of FHIR. - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public ListResource addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (Business identifier) - * - *

- * Definition: - * Identifier for the List assigned for business purposes outside the context of FHIR. - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public ListResource addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for code (What the purpose of this list is). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * This code defines the purpose of the list - why it was created - *

- */ - public CodeableConceptDt getCode() { - if (myCode == null) { - myCode = new CodeableConceptDt(); - } - return myCode; - } - - /** - * Sets the value(s) for code (What the purpose of this list is) - * - *

- * Definition: - * This code defines the purpose of the list - why it was created - *

- */ - public ListResource setCode(CodeableConceptDt theValue) { - myCode = theValue; - return this; - } - - - /** - * Gets the value(s) for subject (If all resources have the same subject). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The common subject (or patient) of the resources that are in the list, if there is one - *

- */ - public ResourceReferenceDt getSubject() { - if (mySubject == null) { - mySubject = new ResourceReferenceDt(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (If all resources have the same subject) - * - *

- * Definition: - * The common subject (or patient) of the resources that are in the list, if there is one - *

- */ - public ListResource setSubject(ResourceReferenceDt theValue) { - mySubject = theValue; - return this; - } - - - /** - * Gets the value(s) for source (Who and/or what defined the list contents). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The entity responsible for deciding what the contents of the list were - *

- */ - public ResourceReferenceDt getSource() { - if (mySource == null) { - mySource = new ResourceReferenceDt(); - } - return mySource; - } - - /** - * Sets the value(s) for source (Who and/or what defined the list contents) - * - *

- * Definition: - * The entity responsible for deciding what the contents of the list were - *

- */ - public ListResource setSource(ResourceReferenceDt theValue) { - mySource = theValue; - return this; - } - - - /** - * Gets the value(s) for date (When the list was prepared). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The date that the list was prepared - *

- */ - public DateTimeDt getDate() { - if (myDate == null) { - myDate = new DateTimeDt(); - } - return myDate; - } - - /** - * Sets the value(s) for date (When the list was prepared) - * - *

- * Definition: - * The date that the list was prepared - *

- */ - public ListResource setDate(DateTimeDt theValue) { - myDate = theValue; - return this; - } - - /** - * Sets the value for date (When the list was prepared) - * - *

- * Definition: - * The date that the list was prepared - *

- */ - public ListResource setDateWithSecondsPrecision( Date theDate) { - myDate = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for date (When the list was prepared) - * - *

- * Definition: - * The date that the list was prepared - *

- */ - public ListResource setDate( Date theDate, TemporalPrecisionEnum thePrecision) { - myDate = new DateTimeDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for ordered (Whether items in the list have a meaningful order). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Whether items in the list have a meaningful order - *

- */ - public BooleanDt getOrdered() { - if (myOrdered == null) { - myOrdered = new BooleanDt(); - } - return myOrdered; - } - - /** - * Sets the value(s) for ordered (Whether items in the list have a meaningful order) - * - *

- * Definition: - * Whether items in the list have a meaningful order - *

- */ - public ListResource setOrdered(BooleanDt theValue) { - myOrdered = theValue; - return this; - } - - /** - * Sets the value for ordered (Whether items in the list have a meaningful order) - * - *

- * Definition: - * Whether items in the list have a meaningful order - *

- */ - public ListResource setOrdered( boolean theBoolean) { - myOrdered = new BooleanDt(theBoolean); - return this; - } - - - /** - * Gets the value(s) for mode (working | snapshot | changes). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted - *

- */ - public BoundCodeDt getMode() { - if (myMode == null) { - myMode = new BoundCodeDt(ListModeEnum.VALUESET_BINDER); - } - return myMode; - } - - /** - * Sets the value(s) for mode (working | snapshot | changes) - * - *

- * Definition: - * How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted - *

- */ - public ListResource setMode(BoundCodeDt theValue) { - myMode = theValue; - return this; - } - - /** - * Sets the value(s) for mode (working | snapshot | changes) - * - *

- * Definition: - * How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted - *

- */ - public ListResource setMode(ListModeEnum theValue) { - getMode().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for entry (Entries in the list). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Entries in this list - *

- */ - public java.util.List getEntry() { - if (myEntry == null) { - myEntry = new java.util.ArrayList(); - } - return myEntry; - } - - /** - * Sets the value(s) for entry (Entries in the list) - * - *

- * Definition: - * Entries in this list - *

- */ - public ListResource setEntry(java.util.List theValue) { - myEntry = theValue; - return this; - } - - /** - * Adds and returns a new value for entry (Entries in the list) - * - *

- * Definition: - * Entries in this list - *

- */ - public Entry addEntry() { - Entry newType = new Entry(); - getEntry().add(newType); - return newType; - } - - /** - * Gets the first repetition for entry (Entries in the list), - * creating it if it does not already exist. - * - *

- * Definition: - * Entries in this list - *

- */ - public Entry getEntryFirstRep() { - if (getEntry().isEmpty()) { - return addEntry(); - } - return getEntry().get(0); - } - - /** - * Gets the value(s) for emptyReason (Why list is empty). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * If the list is empty, why the list is empty - *

- */ - public CodeableConceptDt getEmptyReason() { - if (myEmptyReason == null) { - myEmptyReason = new CodeableConceptDt(); - } - return myEmptyReason; - } - - /** - * Sets the value(s) for emptyReason (Why list is empty) - * - *

- * Definition: - * If the list is empty, why the list is empty - *

- */ - public ListResource setEmptyReason(CodeableConceptDt theValue) { - myEmptyReason = theValue; - return this; - } - - - /** - * Block class for child element: List.entry (Entries in the list) - * - *

- * Definition: - * Entries in this list - *

- */ - @Block() - public static class Entry extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="flag", type=CodeableConceptDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Workflow information about this item", - formalDefinition="The flag allows the system constructing the list to make one or more statements about the role and significance of the item in the list" - ) - private java.util.List myFlag; - - @Child(name="deleted", type=BooleanDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="If this item is actually marked as deleted", - formalDefinition="True if this item is marked as deleted in the list." - ) - private BooleanDt myDeleted; - - @Child(name="date", type=DateTimeDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="When item added to list", - formalDefinition="When this item was added to the list" - ) - private DateTimeDt myDate; - - @Child(name="item", order=3, min=1, max=1, type={ - IResource.class }) - @Description( - shortDefinition="Actual entry", - formalDefinition="A reference to the actual resource from which data was derived" - ) - private ResourceReferenceDt myItem; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myFlag, myDeleted, myDate, myItem); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myFlag, myDeleted, myDate, myItem); - } - - /** - * Gets the value(s) for flag (Workflow information about this item). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The flag allows the system constructing the list to make one or more statements about the role and significance of the item in the list - *

- */ - public java.util.List getFlag() { - if (myFlag == null) { - myFlag = new java.util.ArrayList(); - } - return myFlag; - } - - /** - * Sets the value(s) for flag (Workflow information about this item) - * - *

- * Definition: - * The flag allows the system constructing the list to make one or more statements about the role and significance of the item in the list - *

- */ - public Entry setFlag(java.util.List theValue) { - myFlag = theValue; - return this; - } - - /** - * Adds and returns a new value for flag (Workflow information about this item) - * - *

- * Definition: - * The flag allows the system constructing the list to make one or more statements about the role and significance of the item in the list - *

- */ - public CodeableConceptDt addFlag() { - CodeableConceptDt newType = new CodeableConceptDt(); - getFlag().add(newType); - return newType; - } - - /** - * Gets the first repetition for flag (Workflow information about this item), - * creating it if it does not already exist. - * - *

- * Definition: - * The flag allows the system constructing the list to make one or more statements about the role and significance of the item in the list - *

- */ - public CodeableConceptDt getFlagFirstRep() { - if (getFlag().isEmpty()) { - return addFlag(); - } - return getFlag().get(0); - } - - /** - * Gets the value(s) for deleted (If this item is actually marked as deleted). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * True if this item is marked as deleted in the list. - *

- */ - public BooleanDt getDeleted() { - if (myDeleted == null) { - myDeleted = new BooleanDt(); - } - return myDeleted; - } - - /** - * Sets the value(s) for deleted (If this item is actually marked as deleted) - * - *

- * Definition: - * True if this item is marked as deleted in the list. - *

- */ - public Entry setDeleted(BooleanDt theValue) { - myDeleted = theValue; - return this; - } - - /** - * Sets the value for deleted (If this item is actually marked as deleted) - * - *

- * Definition: - * True if this item is marked as deleted in the list. - *

- */ - public Entry setDeleted( boolean theBoolean) { - myDeleted = new BooleanDt(theBoolean); - return this; - } - - - /** - * Gets the value(s) for date (When item added to list). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * When this item was added to the list - *

- */ - public DateTimeDt getDate() { - if (myDate == null) { - myDate = new DateTimeDt(); - } - return myDate; - } - - /** - * Sets the value(s) for date (When item added to list) - * - *

- * Definition: - * When this item was added to the list - *

- */ - public Entry setDate(DateTimeDt theValue) { - myDate = theValue; - return this; - } - - /** - * Sets the value for date (When item added to list) - * - *

- * Definition: - * When this item was added to the list - *

- */ - public Entry setDateWithSecondsPrecision( Date theDate) { - myDate = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for date (When item added to list) - * - *

- * Definition: - * When this item was added to the list - *

- */ - public Entry setDate( Date theDate, TemporalPrecisionEnum thePrecision) { - myDate = new DateTimeDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for item (Actual entry). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A reference to the actual resource from which data was derived - *

- */ - public ResourceReferenceDt getItem() { - if (myItem == null) { - myItem = new ResourceReferenceDt(); - } - return myItem; - } - - /** - * Sets the value(s) for item (Actual entry) - * - *

- * Definition: - * A reference to the actual resource from which data was derived - *

- */ - public Entry setItem(ResourceReferenceDt theValue) { - myItem = theValue; - return this; - } - - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Location.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Location.java deleted file mode 100644 index 1641976d8b5..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Location.java +++ /dev/null @@ -1,1155 +0,0 @@ - - - - - - - - - - - - - - - - -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.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.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.AddressDt; -import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.ContactDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationModeEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.LocationTypeEnum; -import ca.uhn.fhir.model.primitive.BoundCodeDt; -import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; -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.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.StringClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR Location Resource - * (Details and position information for a physical place) - * - *

- * Definition: - * Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained or accommodated - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Location - *

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

- * Description:
- * Type: token
- * Path: Location.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Location.identifier", description="", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - - /** - * Fluent Client search parameter constant for identifier - *

- * Description:
- * Type: token
- * Path: Location.identifier
- *

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

- * Description: A (portion of the) name of the location
- * Type: string
- * Path: Location.name
- *

- */ - @SearchParamDefinition(name="name", path="Location.name", description="A (portion of the) name of the location", type="string" ) - public static final String SP_NAME = "name"; - - /** - * Fluent Client search parameter constant for name - *

- * Description: A (portion of the) name of the location
- * Type: string
- * Path: Location.name
- *

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

- * Description: A code for the type of location
- * Type: token
- * Path: Location.type
- *

- */ - @SearchParamDefinition(name="type", path="Location.type", description="A code for the type of location", type="token" ) - public static final String SP_TYPE = "type"; - - /** - * Fluent Client search parameter constant for type - *

- * Description: A code for the type of location
- * Type: token
- * Path: Location.type
- *

- */ - public static final TokenClientParam TYPE = new TokenClientParam(SP_TYPE); - - /** - * Search parameter constant for address - *

- * Description: A (part of the) address of the location
- * Type: string
- * Path: Location.address
- *

- */ - @SearchParamDefinition(name="address", path="Location.address", description="A (part of the) address of the location", type="string" ) - public static final String SP_ADDRESS = "address"; - - /** - * Fluent Client search parameter constant for address - *

- * Description: A (part of the) address of the location
- * Type: string
- * Path: Location.address
- *

- */ - public static final StringClientParam ADDRESS = new StringClientParam(SP_ADDRESS); - - /** - * Search parameter constant for status - *

- * Description: Searches for locations with a specific kind of status
- * Type: token
- * Path: Location.status
- *

- */ - @SearchParamDefinition(name="status", path="Location.status", description="Searches for locations with a specific kind of status", type="token" ) - public static final String SP_STATUS = "status"; - - /** - * Fluent Client search parameter constant for status - *

- * Description: Searches for locations with a specific kind of status
- * Type: token
- * Path: Location.status
- *

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

- * Description: The location of which this location is a part
- * Type: reference
- * Path: Location.partOf
- *

- */ - @SearchParamDefinition(name="partof", path="Location.partOf", description="The location of which this location is a part", type="reference" ) - public static final String SP_PARTOF = "partof"; - - /** - * Fluent Client search parameter constant for partof - *

- * Description: The location of which this location is a part
- * Type: reference
- * Path: Location.partOf
- *

- */ - public static final ReferenceClientParam PARTOF = new ReferenceClientParam(SP_PARTOF); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Location.partOf". - */ - public static final Include INCLUDE_PARTOF = new Include("Location.partOf"); - - /** - * Search parameter constant for near - *

- * Description: The coordinates expressed as [lat],[long] (using KML, see notes) to find locations near to (servers may search using a square rather than a circle for efficiency)
- * Type: token
- * Path:
- *

- */ - @SearchParamDefinition(name="near", path="", description="The coordinates expressed as [lat],[long] (using KML, see notes) to find locations near to (servers may search using a square rather than a circle for efficiency)", type="token" ) - public static final String SP_NEAR = "near"; - - /** - * Fluent Client search parameter constant for near - *

- * Description: The coordinates expressed as [lat],[long] (using KML, see notes) to find locations near to (servers may search using a square rather than a circle for efficiency)
- * Type: token
- * Path:
- *

- */ - public static final TokenClientParam NEAR = new TokenClientParam(SP_NEAR); - - /** - * Search parameter constant for near-distance - *

- * Description: A distance quantity to limit the near search to locations within a specific distance
- * Type: token
- * Path:
- *

- */ - @SearchParamDefinition(name="near-distance", path="", description="A distance quantity to limit the near search to locations within a specific distance", type="token" ) - public static final String SP_NEAR_DISTANCE = "near-distance"; - - /** - * Fluent Client search parameter constant for near-distance - *

- * Description: A distance quantity to limit the near search to locations within a specific distance
- * Type: token
- * Path:
- *

- */ - public static final TokenClientParam NEAR_DISTANCE = new TokenClientParam(SP_NEAR_DISTANCE); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Unique code or number identifying the location to its users", - formalDefinition="Unique code or number identifying the location to its users" - ) - private IdentifierDt myIdentifier; - - @Child(name="name", type=StringDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Name of the location as used by humans", - formalDefinition="Name of the location as used by humans. Does not need to be unique." - ) - private StringDt myName; - - @Child(name="description", type=StringDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Description of the Location, which helps in finding or referencing the place", - formalDefinition="Description of the Location, which helps in finding or referencing the place" - ) - private StringDt myDescription; - - @Child(name="type", type=CodeableConceptDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Indicates the type of function performed at the location", - formalDefinition="Indicates the type of function performed at the location" - ) - private BoundCodeableConceptDt myType; - - @Child(name="telecom", type=ContactDt.class, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Contact details of the location", - formalDefinition="The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites" - ) - private java.util.List myTelecom; - - @Child(name="address", type=AddressDt.class, order=5, min=0, max=1) - @Description( - shortDefinition="Physical location", - formalDefinition="" - ) - private AddressDt myAddress; - - @Child(name="physicalType", type=CodeableConceptDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="Physical form of the location", - formalDefinition="Physical form of the location, e.g. building, room, vehicle, road" - ) - private CodeableConceptDt myPhysicalType; - - @Child(name="position", order=7, min=0, max=1) - @Description( - shortDefinition="The absolute geographic location", - formalDefinition="The absolute geographic location of the Location, expressed in a KML compatible manner (see notes below for KML)" - ) - private Position myPosition; - - @Child(name="managingOrganization", order=8, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Organization.class }) - @Description( - shortDefinition="The organization that is responsible for the provisioning and upkeep of the location", - formalDefinition="" - ) - private ResourceReferenceDt myManagingOrganization; - - @Child(name="status", type=CodeDt.class, order=9, min=0, max=1) - @Description( - shortDefinition="active | suspended | inactive", - formalDefinition="" - ) - private BoundCodeDt myStatus; - - @Child(name="partOf", order=10, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Location.class }) - @Description( - shortDefinition="Another Location which this Location is physically part of", - formalDefinition="" - ) - private ResourceReferenceDt myPartOf; - - @Child(name="mode", type=CodeDt.class, order=11, min=0, max=1) - @Description( - shortDefinition="instance | kind", - formalDefinition="Indicates whether a resource instance represents a specific location or a class of locations" - ) - private BoundCodeDt myMode; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myName, myDescription, myType, myTelecom, myAddress, myPhysicalType, myPosition, myManagingOrganization, myStatus, myPartOf, myMode); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myName, myDescription, myType, myTelecom, myAddress, myPhysicalType, myPosition, myManagingOrganization, myStatus, myPartOf, myMode); - } - - /** - * Gets the value(s) for identifier (Unique code or number identifying the location to its users). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Unique code or number identifying the location to its users - *

- */ - public IdentifierDt getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new IdentifierDt(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Unique code or number identifying the location to its users) - * - *

- * Definition: - * Unique code or number identifying the location to its users - *

- */ - public Location setIdentifier(IdentifierDt theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Sets the value for identifier (Unique code or number identifying the location to its users) - * - *

- * Definition: - * Unique code or number identifying the location to its users - *

- */ - public Location setIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - myIdentifier = new IdentifierDt(theUse, theSystem, theValue, theLabel); - return this; - } - - /** - * Sets the value for identifier (Unique code or number identifying the location to its users) - * - *

- * Definition: - * Unique code or number identifying the location to its users - *

- */ - public Location setIdentifier( String theSystem, String theValue) { - myIdentifier = new IdentifierDt(theSystem, theValue); - return this; - } - - - /** - * Gets the value(s) for name (Name of the location as used by humans). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Name of the location as used by humans. Does not need to be unique. - *

- */ - public StringDt getName() { - if (myName == null) { - myName = new StringDt(); - } - return myName; - } - - /** - * Sets the value(s) for name (Name of the location as used by humans) - * - *

- * Definition: - * Name of the location as used by humans. Does not need to be unique. - *

- */ - public Location setName(StringDt theValue) { - myName = theValue; - return this; - } - - /** - * Sets the value for name (Name of the location as used by humans) - * - *

- * Definition: - * Name of the location as used by humans. Does not need to be unique. - *

- */ - public Location setName( String theString) { - myName = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for description (Description of the Location, which helps in finding or referencing the place). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Description of the Location, which helps in finding or referencing the place - *

- */ - public StringDt getDescription() { - if (myDescription == null) { - myDescription = new StringDt(); - } - return myDescription; - } - - /** - * Sets the value(s) for description (Description of the Location, which helps in finding or referencing the place) - * - *

- * Definition: - * Description of the Location, which helps in finding or referencing the place - *

- */ - public Location setDescription(StringDt theValue) { - myDescription = theValue; - return this; - } - - /** - * Sets the value for description (Description of the Location, which helps in finding or referencing the place) - * - *

- * Definition: - * Description of the Location, which helps in finding or referencing the place - *

- */ - public Location setDescription( String theString) { - myDescription = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for type (Indicates the type of function performed at the location). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates the type of function performed at the location - *

- */ - public BoundCodeableConceptDt getType() { - if (myType == null) { - myType = new BoundCodeableConceptDt(LocationTypeEnum.VALUESET_BINDER); - } - return myType; - } - - /** - * Sets the value(s) for type (Indicates the type of function performed at the location) - * - *

- * Definition: - * Indicates the type of function performed at the location - *

- */ - public Location setType(BoundCodeableConceptDt theValue) { - myType = theValue; - return this; - } - - /** - * Sets the value(s) for type (Indicates the type of function performed at the location) - * - *

- * Definition: - * Indicates the type of function performed at the location - *

- */ - public Location setType(LocationTypeEnum theValue) { - getType().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for telecom (Contact details of the location). - * creating it if it does - * not exist. Will not return null. - * - *

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

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

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

- */ - public Location setTelecom(java.util.List theValue) { - myTelecom = theValue; - return this; - } - - /** - * Adds and returns a new value for telecom (Contact details of the location) - * - *

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

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

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

- */ - public ContactDt getTelecomFirstRep() { - if (getTelecom().isEmpty()) { - return addTelecom(); - } - return getTelecom().get(0); - } - /** - * Adds a new value for telecom (Contact details of the location) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Location 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 details of the location) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Location addTelecom( String theValue) { - if (myTelecom == null) { - myTelecom = new java.util.ArrayList(); - } - myTelecom.add(new ContactDt(theValue)); - return this; - } - - - /** - * Gets the value(s) for address (Physical location). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public AddressDt getAddress() { - if (myAddress == null) { - myAddress = new AddressDt(); - } - return myAddress; - } - - /** - * Sets the value(s) for address (Physical location) - * - *

- * Definition: - * - *

- */ - public Location setAddress(AddressDt theValue) { - myAddress = theValue; - return this; - } - - - /** - * Gets the value(s) for physicalType (Physical form of the location). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Physical form of the location, e.g. building, room, vehicle, road - *

- */ - public CodeableConceptDt getPhysicalType() { - if (myPhysicalType == null) { - myPhysicalType = new CodeableConceptDt(); - } - return myPhysicalType; - } - - /** - * Sets the value(s) for physicalType (Physical form of the location) - * - *

- * Definition: - * Physical form of the location, e.g. building, room, vehicle, road - *

- */ - public Location setPhysicalType(CodeableConceptDt theValue) { - myPhysicalType = theValue; - return this; - } - - - /** - * Gets the value(s) for position (The absolute geographic location). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The absolute geographic location of the Location, expressed in a KML compatible manner (see notes below for KML) - *

- */ - public Position getPosition() { - if (myPosition == null) { - myPosition = new Position(); - } - return myPosition; - } - - /** - * Sets the value(s) for position (The absolute geographic location) - * - *

- * Definition: - * The absolute geographic location of the Location, expressed in a KML compatible manner (see notes below for KML) - *

- */ - public Location setPosition(Position theValue) { - myPosition = theValue; - return this; - } - - - /** - * Gets the value(s) for managingOrganization (The organization that is responsible for the provisioning and upkeep of the location). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt getManagingOrganization() { - if (myManagingOrganization == null) { - myManagingOrganization = new ResourceReferenceDt(); - } - return myManagingOrganization; - } - - /** - * Sets the value(s) for managingOrganization (The organization that is responsible for the provisioning and upkeep of the location) - * - *

- * Definition: - * - *

- */ - public Location setManagingOrganization(ResourceReferenceDt theValue) { - myManagingOrganization = theValue; - return this; - } - - - /** - * Gets the value(s) for status (active | suspended | inactive). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public BoundCodeDt getStatus() { - if (myStatus == null) { - myStatus = new BoundCodeDt(LocationStatusEnum.VALUESET_BINDER); - } - return myStatus; - } - - /** - * Sets the value(s) for status (active | suspended | inactive) - * - *

- * Definition: - * - *

- */ - public Location setStatus(BoundCodeDt theValue) { - myStatus = theValue; - return this; - } - - /** - * Sets the value(s) for status (active | suspended | inactive) - * - *

- * Definition: - * - *

- */ - public Location setStatus(LocationStatusEnum theValue) { - getStatus().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for partOf (Another Location which this Location is physically part of). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt getPartOf() { - if (myPartOf == null) { - myPartOf = new ResourceReferenceDt(); - } - return myPartOf; - } - - /** - * Sets the value(s) for partOf (Another Location which this Location is physically part of) - * - *

- * Definition: - * - *

- */ - public Location setPartOf(ResourceReferenceDt theValue) { - myPartOf = theValue; - return this; - } - - - /** - * Gets the value(s) for mode (instance | kind). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates whether a resource instance represents a specific location or a class of locations - *

- */ - public BoundCodeDt getMode() { - if (myMode == null) { - myMode = new BoundCodeDt(LocationModeEnum.VALUESET_BINDER); - } - return myMode; - } - - /** - * Sets the value(s) for mode (instance | kind) - * - *

- * Definition: - * Indicates whether a resource instance represents a specific location or a class of locations - *

- */ - public Location setMode(BoundCodeDt theValue) { - myMode = theValue; - return this; - } - - /** - * Sets the value(s) for mode (instance | kind) - * - *

- * Definition: - * Indicates whether a resource instance represents a specific location or a class of locations - *

- */ - public Location setMode(LocationModeEnum theValue) { - getMode().setValueAsEnum(theValue); - return this; - } - - - /** - * Block class for child element: Location.position (The absolute geographic location) - * - *

- * Definition: - * The absolute geographic location of the Location, expressed in a KML compatible manner (see notes below for KML) - *

- */ - @Block() - public static class Position extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="longitude", type=DecimalDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Longitude as expressed in KML", - formalDefinition="Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below)" - ) - private DecimalDt myLongitude; - - @Child(name="latitude", type=DecimalDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="Latitude as expressed in KML", - formalDefinition="Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below)" - ) - private DecimalDt myLatitude; - - @Child(name="altitude", type=DecimalDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Altitude as expressed in KML", - formalDefinition="Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below)" - ) - private DecimalDt myAltitude; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myLongitude, myLatitude, myAltitude); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myLongitude, myLatitude, myAltitude); - } - - /** - * Gets the value(s) for longitude (Longitude as expressed in KML). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below) - *

- */ - public DecimalDt getLongitude() { - if (myLongitude == null) { - myLongitude = new DecimalDt(); - } - return myLongitude; - } - - /** - * Sets the value(s) for longitude (Longitude as expressed in KML) - * - *

- * Definition: - * Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below) - *

- */ - public Position setLongitude(DecimalDt theValue) { - myLongitude = theValue; - return this; - } - - /** - * Sets the value for longitude (Longitude as expressed in KML) - * - *

- * Definition: - * Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below) - *

- */ - public Position setLongitude( long theValue) { - myLongitude = new DecimalDt(theValue); - return this; - } - - /** - * Sets the value for longitude (Longitude as expressed in KML) - * - *

- * Definition: - * Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below) - *

- */ - public Position setLongitude( double theValue) { - myLongitude = new DecimalDt(theValue); - return this; - } - - /** - * Sets the value for longitude (Longitude as expressed in KML) - * - *

- * Definition: - * Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below) - *

- */ - public Position setLongitude( java.math.BigDecimal theValue) { - myLongitude = new DecimalDt(theValue); - return this; - } - - - /** - * Gets the value(s) for latitude (Latitude as expressed in KML). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below) - *

- */ - public DecimalDt getLatitude() { - if (myLatitude == null) { - myLatitude = new DecimalDt(); - } - return myLatitude; - } - - /** - * Sets the value(s) for latitude (Latitude as expressed in KML) - * - *

- * Definition: - * Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below) - *

- */ - public Position setLatitude(DecimalDt theValue) { - myLatitude = theValue; - return this; - } - - /** - * Sets the value for latitude (Latitude as expressed in KML) - * - *

- * Definition: - * Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below) - *

- */ - public Position setLatitude( long theValue) { - myLatitude = new DecimalDt(theValue); - return this; - } - - /** - * Sets the value for latitude (Latitude as expressed in KML) - * - *

- * Definition: - * Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below) - *

- */ - public Position setLatitude( double theValue) { - myLatitude = new DecimalDt(theValue); - return this; - } - - /** - * Sets the value for latitude (Latitude as expressed in KML) - * - *

- * Definition: - * Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below) - *

- */ - public Position setLatitude( java.math.BigDecimal theValue) { - myLatitude = new DecimalDt(theValue); - return this; - } - - - /** - * Gets the value(s) for altitude (Altitude as expressed in KML). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below) - *

- */ - public DecimalDt getAltitude() { - if (myAltitude == null) { - myAltitude = new DecimalDt(); - } - return myAltitude; - } - - /** - * Sets the value(s) for altitude (Altitude as expressed in KML) - * - *

- * Definition: - * Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below) - *

- */ - public Position setAltitude(DecimalDt theValue) { - myAltitude = theValue; - return this; - } - - /** - * Sets the value for altitude (Altitude as expressed in KML) - * - *

- * Definition: - * Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below) - *

- */ - public Position setAltitude( long theValue) { - myAltitude = new DecimalDt(theValue); - return this; - } - - /** - * Sets the value for altitude (Altitude as expressed in KML) - * - *

- * Definition: - * Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below) - *

- */ - public Position setAltitude( double theValue) { - myAltitude = new DecimalDt(theValue); - return this; - } - - /** - * Sets the value for altitude (Altitude as expressed in KML) - * - *

- * Definition: - * Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below) - *

- */ - public Position setAltitude( java.math.BigDecimal theValue) { - myAltitude = new DecimalDt(theValue); - return this; - } - - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Media.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Media.java deleted file mode 100644 index 5d204d022e1..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Media.java +++ /dev/null @@ -1,929 +0,0 @@ - - - - - - - - - - - - - - - - -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.BaseResource; -import ca.uhn.fhir.model.api.IElement; -import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.api.Include; -import ca.uhn.fhir.model.api.TemporalPrecisionEnum; -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.Description; -import ca.uhn.fhir.model.api.annotation.ResourceDef; -import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; -import ca.uhn.fhir.model.dstu.composite.AttachmentDt; -import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.MediaTypeEnum; -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.IntegerDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.rest.gclient.DateClientParam; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR Media Resource - * (A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference) - * - *

- * Definition: - * A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Media - *

- * - */ -@ResourceDef(name="Media", profile="http://hl7.org/fhir/profiles/Media", id="media") -public class Media extends BaseResource implements IResource { - - /** - * Search parameter constant for type - *

- * Description:
- * Type: token
- * Path: Media.type
- *

- */ - @SearchParamDefinition(name="type", path="Media.type", description="", type="token" ) - public static final String SP_TYPE = "type"; - - /** - * Fluent Client search parameter constant for type - *

- * Description:
- * Type: token
- * Path: Media.type
- *

- */ - public static final TokenClientParam TYPE = new TokenClientParam(SP_TYPE); - - /** - * Search parameter constant for subtype - *

- * Description:
- * Type: token
- * Path: Media.subtype
- *

- */ - @SearchParamDefinition(name="subtype", path="Media.subtype", description="", type="token" ) - public static final String SP_SUBTYPE = "subtype"; - - /** - * Fluent Client search parameter constant for subtype - *

- * Description:
- * Type: token
- * Path: Media.subtype
- *

- */ - public static final TokenClientParam SUBTYPE = new TokenClientParam(SP_SUBTYPE); - - /** - * Search parameter constant for identifier - *

- * Description:
- * Type: token
- * Path: Media.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Media.identifier", description="", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - - /** - * Fluent Client search parameter constant for identifier - *

- * Description:
- * Type: token
- * Path: Media.identifier
- *

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

- * Description:
- * Type: date
- * Path: Media.dateTime
- *

- */ - @SearchParamDefinition(name="date", path="Media.dateTime", description="", type="date" ) - public static final String SP_DATE = "date"; - - /** - * Fluent Client search parameter constant for date - *

- * Description:
- * Type: date
- * Path: Media.dateTime
- *

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

- * Description:
- * Type: reference
- * Path: Media.subject
- *

- */ - @SearchParamDefinition(name="subject", path="Media.subject", description="", type="reference" ) - public static final String SP_SUBJECT = "subject"; - - /** - * Fluent Client search parameter constant for subject - *

- * Description:
- * Type: reference
- * Path: Media.subject
- *

- */ - public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Media.subject". - */ - public static final Include INCLUDE_SUBJECT = new Include("Media.subject"); - - /** - * Search parameter constant for operator - *

- * Description:
- * Type: reference
- * Path: Media.operator
- *

- */ - @SearchParamDefinition(name="operator", path="Media.operator", description="", type="reference" ) - public static final String SP_OPERATOR = "operator"; - - /** - * Fluent Client search parameter constant for operator - *

- * Description:
- * Type: reference
- * Path: Media.operator
- *

- */ - public static final ReferenceClientParam OPERATOR = new ReferenceClientParam(SP_OPERATOR); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Media.operator". - */ - public static final Include INCLUDE_OPERATOR = new Include("Media.operator"); - - /** - * Search parameter constant for view - *

- * Description:
- * Type: token
- * Path: Media.view
- *

- */ - @SearchParamDefinition(name="view", path="Media.view", description="", type="token" ) - public static final String SP_VIEW = "view"; - - /** - * Fluent Client search parameter constant for view - *

- * Description:
- * Type: token
- * Path: Media.view
- *

- */ - public static final TokenClientParam VIEW = new TokenClientParam(SP_VIEW); - - - @Child(name="type", type=CodeDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="photo | video | audio", - formalDefinition="Whether the media is a photo (still image), an audio recording, or a video recording" - ) - private BoundCodeDt myType; - - @Child(name="subtype", type=CodeableConceptDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="The type of acquisition equipment/process", - formalDefinition="Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality" - ) - private CodeableConceptDt mySubtype; - - @Child(name="identifier", type=IdentifierDt.class, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Identifier(s) for the image", - formalDefinition="Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers" - ) - private java.util.List myIdentifier; - - @Child(name="dateTime", type=DateTimeDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="When the media was taken/recorded (end)", - formalDefinition="When the media was originally recorded. For video and audio, if the length of the recording is not insignificant, this is the end of the recording" - ) - private DateTimeDt myDateTime; - - @Child(name="subject", order=4, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Group.class, ca.uhn.fhir.model.dstu.resource.Device.class, ca.uhn.fhir.model.dstu.resource.Specimen.class }) - @Description( - shortDefinition="Who/What this Media is a record of", - formalDefinition="Who/What this Media is a record of" - ) - private ResourceReferenceDt mySubject; - - @Child(name="operator", order=5, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class }) - @Description( - shortDefinition="The person who generated the image", - formalDefinition="The person who administered the collection of the image" - ) - private ResourceReferenceDt myOperator; - - @Child(name="view", type=CodeableConceptDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="Imaging view e.g Lateral or Antero-posterior", - formalDefinition="The name of the imaging view e.g Lateral or Antero-posterior (AP)." - ) - private CodeableConceptDt myView; - - @Child(name="deviceName", type=StringDt.class, order=7, min=0, max=1) - @Description( - shortDefinition="Name of the device/manufacturer", - formalDefinition="The name of the device / manufacturer of the device that was used to make the recording" - ) - private StringDt myDeviceName; - - @Child(name="height", type=IntegerDt.class, order=8, min=0, max=1) - @Description( - shortDefinition="Height of the image in pixels(photo/video)", - formalDefinition="Height of the image in pixels(photo/video)" - ) - private IntegerDt myHeight; - - @Child(name="width", type=IntegerDt.class, order=9, min=0, max=1) - @Description( - shortDefinition="Width of the image in pixels (photo/video)", - formalDefinition="Width of the image in pixels (photo/video)" - ) - private IntegerDt myWidth; - - @Child(name="frames", type=IntegerDt.class, order=10, min=0, max=1) - @Description( - shortDefinition="Number of frames if > 1 (photo)", - formalDefinition="The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required" - ) - private IntegerDt myFrames; - - @Child(name="length", type=IntegerDt.class, order=11, min=0, max=1) - @Description( - shortDefinition="Length in seconds (audio / video)", - formalDefinition="The length of the recording in seconds - for audio and video" - ) - private IntegerDt myLength; - - @Child(name="content", type=AttachmentDt.class, order=12, min=1, max=1) - @Description( - shortDefinition="Actual Media - reference or data", - formalDefinition="The actual content of the media - inline or by direct reference to the media source file" - ) - private AttachmentDt myContent; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myType, mySubtype, myIdentifier, myDateTime, mySubject, myOperator, myView, myDeviceName, myHeight, myWidth, myFrames, myLength, myContent); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myType, mySubtype, myIdentifier, myDateTime, mySubject, myOperator, myView, myDeviceName, myHeight, myWidth, myFrames, myLength, myContent); - } - - /** - * Gets the value(s) for type (photo | video | audio). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Whether the media is a photo (still image), an audio recording, or a video recording - *

- */ - public BoundCodeDt getType() { - if (myType == null) { - myType = new BoundCodeDt(MediaTypeEnum.VALUESET_BINDER); - } - return myType; - } - - /** - * Sets the value(s) for type (photo | video | audio) - * - *

- * Definition: - * Whether the media is a photo (still image), an audio recording, or a video recording - *

- */ - public Media setType(BoundCodeDt theValue) { - myType = theValue; - return this; - } - - /** - * Sets the value(s) for type (photo | video | audio) - * - *

- * Definition: - * Whether the media is a photo (still image), an audio recording, or a video recording - *

- */ - public Media setType(MediaTypeEnum theValue) { - getType().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for subtype (The type of acquisition equipment/process). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality - *

- */ - public CodeableConceptDt getSubtype() { - if (mySubtype == null) { - mySubtype = new CodeableConceptDt(); - } - return mySubtype; - } - - /** - * Sets the value(s) for subtype (The type of acquisition equipment/process) - * - *

- * Definition: - * Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality - *

- */ - public Media setSubtype(CodeableConceptDt theValue) { - mySubtype = theValue; - return this; - } - - - /** - * Gets the value(s) for identifier (Identifier(s) for the image). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Identifier(s) for the image) - * - *

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

- */ - public Media setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (Identifier(s) for the image) - * - *

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

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (Identifier(s) for the image), - * creating it if it does not already exist. - * - *

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

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (Identifier(s) for the image) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Media addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (Identifier(s) for the image) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Media addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for dateTime (When the media was taken/recorded (end)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * When the media was originally recorded. For video and audio, if the length of the recording is not insignificant, this is the end of the recording - *

- */ - public DateTimeDt getDateTime() { - if (myDateTime == null) { - myDateTime = new DateTimeDt(); - } - return myDateTime; - } - - /** - * Sets the value(s) for dateTime (When the media was taken/recorded (end)) - * - *

- * Definition: - * When the media was originally recorded. For video and audio, if the length of the recording is not insignificant, this is the end of the recording - *

- */ - public Media setDateTime(DateTimeDt theValue) { - myDateTime = theValue; - return this; - } - - /** - * Sets the value for dateTime (When the media was taken/recorded (end)) - * - *

- * Definition: - * When the media was originally recorded. For video and audio, if the length of the recording is not insignificant, this is the end of the recording - *

- */ - public Media setDateTimeWithSecondsPrecision( Date theDate) { - myDateTime = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for dateTime (When the media was taken/recorded (end)) - * - *

- * Definition: - * When the media was originally recorded. For video and audio, if the length of the recording is not insignificant, this is the end of the recording - *

- */ - public Media setDateTime( Date theDate, TemporalPrecisionEnum thePrecision) { - myDateTime = new DateTimeDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for subject (Who/What this Media is a record of). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Who/What this Media is a record of - *

- */ - public ResourceReferenceDt getSubject() { - if (mySubject == null) { - mySubject = new ResourceReferenceDt(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (Who/What this Media is a record of) - * - *

- * Definition: - * Who/What this Media is a record of - *

- */ - public Media setSubject(ResourceReferenceDt theValue) { - mySubject = theValue; - return this; - } - - - /** - * Gets the value(s) for operator (The person who generated the image). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The person who administered the collection of the image - *

- */ - public ResourceReferenceDt getOperator() { - if (myOperator == null) { - myOperator = new ResourceReferenceDt(); - } - return myOperator; - } - - /** - * Sets the value(s) for operator (The person who generated the image) - * - *

- * Definition: - * The person who administered the collection of the image - *

- */ - public Media setOperator(ResourceReferenceDt theValue) { - myOperator = theValue; - return this; - } - - - /** - * Gets the value(s) for view (Imaging view e.g Lateral or Antero-posterior). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The name of the imaging view e.g Lateral or Antero-posterior (AP). - *

- */ - public CodeableConceptDt getView() { - if (myView == null) { - myView = new CodeableConceptDt(); - } - return myView; - } - - /** - * Sets the value(s) for view (Imaging view e.g Lateral or Antero-posterior) - * - *

- * Definition: - * The name of the imaging view e.g Lateral or Antero-posterior (AP). - *

- */ - public Media setView(CodeableConceptDt theValue) { - myView = theValue; - return this; - } - - - /** - * Gets the value(s) for deviceName (Name of the device/manufacturer). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The name of the device / manufacturer of the device that was used to make the recording - *

- */ - public StringDt getDeviceName() { - if (myDeviceName == null) { - myDeviceName = new StringDt(); - } - return myDeviceName; - } - - /** - * Sets the value(s) for deviceName (Name of the device/manufacturer) - * - *

- * Definition: - * The name of the device / manufacturer of the device that was used to make the recording - *

- */ - public Media setDeviceName(StringDt theValue) { - myDeviceName = theValue; - return this; - } - - /** - * Sets the value for deviceName (Name of the device/manufacturer) - * - *

- * Definition: - * The name of the device / manufacturer of the device that was used to make the recording - *

- */ - public Media setDeviceName( String theString) { - myDeviceName = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for height (Height of the image in pixels(photo/video)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Height of the image in pixels(photo/video) - *

- */ - public IntegerDt getHeight() { - if (myHeight == null) { - myHeight = new IntegerDt(); - } - return myHeight; - } - - /** - * Sets the value(s) for height (Height of the image in pixels(photo/video)) - * - *

- * Definition: - * Height of the image in pixels(photo/video) - *

- */ - public Media setHeight(IntegerDt theValue) { - myHeight = theValue; - return this; - } - - /** - * Sets the value for height (Height of the image in pixels(photo/video)) - * - *

- * Definition: - * Height of the image in pixels(photo/video) - *

- */ - public Media setHeight( int theInteger) { - myHeight = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for width (Width of the image in pixels (photo/video)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Width of the image in pixels (photo/video) - *

- */ - public IntegerDt getWidth() { - if (myWidth == null) { - myWidth = new IntegerDt(); - } - return myWidth; - } - - /** - * Sets the value(s) for width (Width of the image in pixels (photo/video)) - * - *

- * Definition: - * Width of the image in pixels (photo/video) - *

- */ - public Media setWidth(IntegerDt theValue) { - myWidth = theValue; - return this; - } - - /** - * Sets the value for width (Width of the image in pixels (photo/video)) - * - *

- * Definition: - * Width of the image in pixels (photo/video) - *

- */ - public Media setWidth( int theInteger) { - myWidth = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for frames (Number of frames if > 1 (photo)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required - *

- */ - public IntegerDt getFrames() { - if (myFrames == null) { - myFrames = new IntegerDt(); - } - return myFrames; - } - - /** - * Sets the value(s) for frames (Number of frames if > 1 (photo)) - * - *

- * Definition: - * The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required - *

- */ - public Media setFrames(IntegerDt theValue) { - myFrames = theValue; - return this; - } - - /** - * Sets the value for frames (Number of frames if > 1 (photo)) - * - *

- * Definition: - * The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required - *

- */ - public Media setFrames( int theInteger) { - myFrames = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for length (Length in seconds (audio / video)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The length of the recording in seconds - for audio and video - *

- */ - public IntegerDt getLength() { - if (myLength == null) { - myLength = new IntegerDt(); - } - return myLength; - } - - /** - * Sets the value(s) for length (Length in seconds (audio / video)) - * - *

- * Definition: - * The length of the recording in seconds - for audio and video - *

- */ - public Media setLength(IntegerDt theValue) { - myLength = theValue; - return this; - } - - /** - * Sets the value for length (Length in seconds (audio / video)) - * - *

- * Definition: - * The length of the recording in seconds - for audio and video - *

- */ - public Media setLength( int theInteger) { - myLength = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for content (Actual Media - reference or data). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The actual content of the media - inline or by direct reference to the media source file - *

- */ - public AttachmentDt getContent() { - if (myContent == null) { - myContent = new AttachmentDt(); - } - return myContent; - } - - /** - * Sets the value(s) for content (Actual Media - reference or data) - * - *

- * Definition: - * The actual content of the media - inline or by direct reference to the media source file - *

- */ - public Media setContent(AttachmentDt theValue) { - myContent = theValue; - return this; - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Medication.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Medication.java deleted file mode 100644 index d0c596caacf..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Medication.java +++ /dev/null @@ -1,821 +0,0 @@ - - - - - - - - - - - - - - - - -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.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.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.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.RatioDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.MedicationKindEnum; -import ca.uhn.fhir.model.primitive.BooleanDt; -import ca.uhn.fhir.model.primitive.BoundCodeDt; -import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.StringClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR Medication Resource - * (Definition of a Medication) - * - *

- * Definition: - * Primarily used for identification and definition of Medication, but also covers ingredients and packaging - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Medication - *

- * - */ -@ResourceDef(name="Medication", profile="http://hl7.org/fhir/profiles/Medication", id="medication") -public class Medication extends BaseResource implements IResource { - - /** - * Search parameter constant for code - *

- * Description:
- * Type: token
- * Path: Medication.code
- *

- */ - @SearchParamDefinition(name="code", path="Medication.code", description="", type="token" ) - public static final String SP_CODE = "code"; - - /** - * Fluent Client search parameter constant for code - *

- * Description:
- * Type: token
- * Path: Medication.code
- *

- */ - public static final TokenClientParam CODE = new TokenClientParam(SP_CODE); - - /** - * Search parameter constant for name - *

- * Description:
- * Type: string
- * Path: Medication.name
- *

- */ - @SearchParamDefinition(name="name", path="Medication.name", description="", type="string" ) - public static final String SP_NAME = "name"; - - /** - * Fluent Client search parameter constant for name - *

- * Description:
- * Type: string
- * Path: Medication.name
- *

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

- * Description:
- * Type: reference
- * Path: Medication.manufacturer
- *

- */ - @SearchParamDefinition(name="manufacturer", path="Medication.manufacturer", description="", type="reference" ) - public static final String SP_MANUFACTURER = "manufacturer"; - - /** - * Fluent Client search parameter constant for manufacturer - *

- * Description:
- * Type: reference
- * Path: Medication.manufacturer
- *

- */ - public static final ReferenceClientParam MANUFACTURER = new ReferenceClientParam(SP_MANUFACTURER); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Medication.manufacturer". - */ - public static final Include INCLUDE_MANUFACTURER = new Include("Medication.manufacturer"); - - /** - * Search parameter constant for form - *

- * Description:
- * Type: token
- * Path: Medication.product.form
- *

- */ - @SearchParamDefinition(name="form", path="Medication.product.form", description="", type="token" ) - public static final String SP_FORM = "form"; - - /** - * Fluent Client search parameter constant for form - *

- * Description:
- * Type: token
- * Path: Medication.product.form
- *

- */ - public static final TokenClientParam FORM = new TokenClientParam(SP_FORM); - - /** - * Search parameter constant for ingredient - *

- * Description:
- * Type: reference
- * Path: Medication.product.ingredient.item
- *

- */ - @SearchParamDefinition(name="ingredient", path="Medication.product.ingredient.item", description="", type="reference" ) - public static final String SP_INGREDIENT = "ingredient"; - - /** - * Fluent Client search parameter constant for ingredient - *

- * Description:
- * Type: reference
- * Path: Medication.product.ingredient.item
- *

- */ - public static final ReferenceClientParam INGREDIENT = new ReferenceClientParam(SP_INGREDIENT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Medication.product.ingredient.item". - */ - public static final Include INCLUDE_PRODUCT_INGREDIENT_ITEM = new Include("Medication.product.ingredient.item"); - - /** - * Search parameter constant for container - *

- * Description:
- * Type: token
- * Path: Medication.package.container
- *

- */ - @SearchParamDefinition(name="container", path="Medication.package.container", description="", type="token" ) - public static final String SP_CONTAINER = "container"; - - /** - * Fluent Client search parameter constant for container - *

- * Description:
- * Type: token
- * Path: Medication.package.container
- *

- */ - public static final TokenClientParam CONTAINER = new TokenClientParam(SP_CONTAINER); - - /** - * Search parameter constant for content - *

- * Description:
- * Type: reference
- * Path: Medication.package.content.item
- *

- */ - @SearchParamDefinition(name="content", path="Medication.package.content.item", description="", type="reference" ) - public static final String SP_CONTENT = "content"; - - /** - * Fluent Client search parameter constant for content - *

- * Description:
- * Type: reference
- * Path: Medication.package.content.item
- *

- */ - public static final ReferenceClientParam CONTENT = new ReferenceClientParam(SP_CONTENT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Medication.package.content.item". - */ - public static final Include INCLUDE_PACKAGE_CONTENT_ITEM = new Include("Medication.package.content.item"); - - - @Child(name="name", type=StringDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Common / Commercial name", - formalDefinition="The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code" - ) - private StringDt myName; - - @Child(name="code", type=CodeableConceptDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Codes that identify this medication", - formalDefinition="A code (or set of codes) that identify this medication. Usage note: This could be a standard drug code such as a drug regulator code, RxNorm code, SNOMED CT code, etc. It could also be a local formulary code, optionally with translations to the standard drug codes" - ) - private CodeableConceptDt myCode; - - @Child(name="isBrand", type=BooleanDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="True if a brand", - formalDefinition="Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is)" - ) - private BooleanDt myIsBrand; - - @Child(name="manufacturer", order=3, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Organization.class }) - @Description( - shortDefinition="Manufacturer of the item", - formalDefinition="Describes the details of the manufacturer" - ) - private ResourceReferenceDt myManufacturer; - - @Child(name="kind", type=CodeDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="product | package", - formalDefinition="Medications are either a single administrable product or a package that contains one or more products." - ) - private BoundCodeDt myKind; - - @Child(name="product", order=5, min=0, max=1) - @Description( - shortDefinition="Administrable medication details", - formalDefinition="Information that only applies to products (not packages)" - ) - private Product myProduct; - - @Child(name="package", type=CodeDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="Details about packaged medications", - formalDefinition="Information that only applies to packages (not products)" - ) - private CodeDt myPackage; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myName, myCode, myIsBrand, myManufacturer, myKind, myProduct, myPackage); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myName, myCode, myIsBrand, myManufacturer, myKind, myProduct, myPackage); - } - - /** - * Gets the value(s) for name (Common / Commercial name). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code - *

- */ - public StringDt getName() { - if (myName == null) { - myName = new StringDt(); - } - return myName; - } - - /** - * Sets the value(s) for name (Common / Commercial name) - * - *

- * Definition: - * The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code - *

- */ - public Medication setName(StringDt theValue) { - myName = theValue; - return this; - } - - /** - * Sets the value for name (Common / Commercial name) - * - *

- * Definition: - * The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code - *

- */ - public Medication setName( String theString) { - myName = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for code (Codes that identify this medication). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A code (or set of codes) that identify this medication. Usage note: This could be a standard drug code such as a drug regulator code, RxNorm code, SNOMED CT code, etc. It could also be a local formulary code, optionally with translations to the standard drug codes - *

- */ - public CodeableConceptDt getCode() { - if (myCode == null) { - myCode = new CodeableConceptDt(); - } - return myCode; - } - - /** - * Sets the value(s) for code (Codes that identify this medication) - * - *

- * Definition: - * A code (or set of codes) that identify this medication. Usage note: This could be a standard drug code such as a drug regulator code, RxNorm code, SNOMED CT code, etc. It could also be a local formulary code, optionally with translations to the standard drug codes - *

- */ - public Medication setCode(CodeableConceptDt theValue) { - myCode = theValue; - return this; - } - - - /** - * Gets the value(s) for isBrand (True if a brand). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is) - *

- */ - public BooleanDt getIsBrand() { - if (myIsBrand == null) { - myIsBrand = new BooleanDt(); - } - return myIsBrand; - } - - /** - * Sets the value(s) for isBrand (True if a brand) - * - *

- * Definition: - * Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is) - *

- */ - public Medication setIsBrand(BooleanDt theValue) { - myIsBrand = theValue; - return this; - } - - /** - * Sets the value for isBrand (True if a brand) - * - *

- * Definition: - * Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is) - *

- */ - public Medication setIsBrand( boolean theBoolean) { - myIsBrand = new BooleanDt(theBoolean); - return this; - } - - - /** - * Gets the value(s) for manufacturer (Manufacturer of the item). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Describes the details of the manufacturer - *

- */ - public ResourceReferenceDt getManufacturer() { - if (myManufacturer == null) { - myManufacturer = new ResourceReferenceDt(); - } - return myManufacturer; - } - - /** - * Sets the value(s) for manufacturer (Manufacturer of the item) - * - *

- * Definition: - * Describes the details of the manufacturer - *

- */ - public Medication setManufacturer(ResourceReferenceDt theValue) { - myManufacturer = theValue; - return this; - } - - - /** - * Gets the value(s) for kind (product | package). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Medications are either a single administrable product or a package that contains one or more products. - *

- */ - public BoundCodeDt getKind() { - if (myKind == null) { - myKind = new BoundCodeDt(MedicationKindEnum.VALUESET_BINDER); - } - return myKind; - } - - /** - * Sets the value(s) for kind (product | package) - * - *

- * Definition: - * Medications are either a single administrable product or a package that contains one or more products. - *

- */ - public Medication setKind(BoundCodeDt theValue) { - myKind = theValue; - return this; - } - - /** - * Sets the value(s) for kind (product | package) - * - *

- * Definition: - * Medications are either a single administrable product or a package that contains one or more products. - *

- */ - public Medication setKind(MedicationKindEnum theValue) { - getKind().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for product (Administrable medication details). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Information that only applies to products (not packages) - *

- */ - public Product getProduct() { - if (myProduct == null) { - myProduct = new Product(); - } - return myProduct; - } - - /** - * Sets the value(s) for product (Administrable medication details) - * - *

- * Definition: - * Information that only applies to products (not packages) - *

- */ - public Medication setProduct(Product theValue) { - myProduct = theValue; - return this; - } - - - /** - * Gets the value(s) for package (Details about packaged medications). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Information that only applies to packages (not products) - *

- */ - public CodeDt getPackage() { - if (myPackage == null) { - myPackage = new CodeDt(); - } - return myPackage; - } - - /** - * Sets the value(s) for package (Details about packaged medications) - * - *

- * Definition: - * Information that only applies to packages (not products) - *

- */ - public Medication setPackage(CodeDt theValue) { - myPackage = theValue; - return this; - } - - /** - * Sets the value for package (Details about packaged medications) - * - *

- * Definition: - * Information that only applies to packages (not products) - *

- */ - public Medication setPackage( String theCode) { - myPackage = new CodeDt(theCode); - return this; - } - - - /** - * Block class for child element: Medication.product (Administrable medication details) - * - *

- * Definition: - * Information that only applies to products (not packages) - *

- */ - @Block() - public static class Product extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="form", type=CodeableConceptDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="powder | tablets | carton +", - formalDefinition="Describes the form of the item. Powder; tables; carton" - ) - private CodeableConceptDt myForm; - - @Child(name="ingredient", order=1, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Active or inactive ingredient", - formalDefinition="Identifies a particular constituent of interest in the product" - ) - private java.util.List myIngredient; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myForm, myIngredient); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myForm, myIngredient); - } - - /** - * Gets the value(s) for form (powder | tablets | carton +). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Describes the form of the item. Powder; tables; carton - *

- */ - public CodeableConceptDt getForm() { - if (myForm == null) { - myForm = new CodeableConceptDt(); - } - return myForm; - } - - /** - * Sets the value(s) for form (powder | tablets | carton +) - * - *

- * Definition: - * Describes the form of the item. Powder; tables; carton - *

- */ - public Product setForm(CodeableConceptDt theValue) { - myForm = theValue; - return this; - } - - - /** - * Gets the value(s) for ingredient (Active or inactive ingredient). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getIngredient() { - if (myIngredient == null) { - myIngredient = new java.util.ArrayList(); - } - return myIngredient; - } - - /** - * Sets the value(s) for ingredient (Active or inactive ingredient) - * - *

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

- */ - public Product setIngredient(java.util.List theValue) { - myIngredient = theValue; - return this; - } - - /** - * Adds and returns a new value for ingredient (Active or inactive ingredient) - * - *

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

- */ - public ProductIngredient addIngredient() { - ProductIngredient newType = new ProductIngredient(); - getIngredient().add(newType); - return newType; - } - - /** - * Gets the first repetition for ingredient (Active or inactive ingredient), - * creating it if it does not already exist. - * - *

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

- */ - public ProductIngredient getIngredientFirstRep() { - if (getIngredient().isEmpty()) { - return addIngredient(); - } - return getIngredient().get(0); - } - - - } - - /** - * Block class for child element: Medication.product.ingredient (Active or inactive ingredient) - * - *

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

- */ - @Block() - public static class ProductIngredient extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="item", order=0, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Substance.class, ca.uhn.fhir.model.dstu.resource.Medication.class }) - @Description( - shortDefinition="The product contained", - formalDefinition="The actual ingredient - either a substance (simple ingredient) or another medication" - ) - private ResourceReferenceDt myItem; - - @Child(name="amount", type=RatioDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="How much ingredient in product", - formalDefinition="Specifies how many (or how much) of the items there are in this Medication. E.g. 250 mg per tablet" - ) - private RatioDt myAmount; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myItem, myAmount); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myItem, myAmount); - } - - /** - * Gets the value(s) for item (The product contained). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The actual ingredient - either a substance (simple ingredient) or another medication - *

- */ - public ResourceReferenceDt getItem() { - if (myItem == null) { - myItem = new ResourceReferenceDt(); - } - return myItem; - } - - /** - * Sets the value(s) for item (The product contained) - * - *

- * Definition: - * The actual ingredient - either a substance (simple ingredient) or another medication - *

- */ - public ProductIngredient setItem(ResourceReferenceDt theValue) { - myItem = theValue; - return this; - } - - - /** - * Gets the value(s) for amount (How much ingredient in product). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Specifies how many (or how much) of the items there are in this Medication. E.g. 250 mg per tablet - *

- */ - public RatioDt getAmount() { - if (myAmount == null) { - myAmount = new RatioDt(); - } - return myAmount; - } - - /** - * Sets the value(s) for amount (How much ingredient in product) - * - *

- * Definition: - * Specifies how many (or how much) of the items there are in this Medication. E.g. 250 mg per tablet - *

- */ - public ProductIngredient setAmount(RatioDt theValue) { - myAmount = theValue; - return this; - } - - - - } - - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationAdministration.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationAdministration.java deleted file mode 100644 index d30786c2278..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationAdministration.java +++ /dev/null @@ -1,1356 +0,0 @@ - - - - - - - - - - - - - - - - -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.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.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.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.RatioDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.MedicationAdministrationStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; -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.rest.gclient.DateClientParam; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR MedicationAdministration Resource - * (Administration of medication to a patient) - * - *

- * Definition: - * Describes the event of a patient being given a dose of a medication. This may be as simple as swallowing a tablet or it may be a long running infusion.Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/MedicationAdministration - *

- * - */ -@ResourceDef(name="MedicationAdministration", profile="http://hl7.org/fhir/profiles/MedicationAdministration", id="medicationadministration") -public class MedicationAdministration extends BaseResource implements IResource { - - /** - * Search parameter constant for device - *

- * Description: Return administrations with this administration device identity
- * Type: reference
- * Path: MedicationAdministration.device
- *

- */ - @SearchParamDefinition(name="device", path="MedicationAdministration.device", description="Return administrations with this administration device identity", type="reference" ) - public static final String SP_DEVICE = "device"; - - /** - * Fluent Client search parameter constant for device - *

- * Description: Return administrations with this administration device identity
- * Type: reference
- * Path: MedicationAdministration.device
- *

- */ - public static final ReferenceClientParam DEVICE = new ReferenceClientParam(SP_DEVICE); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationAdministration.device". - */ - public static final Include INCLUDE_DEVICE = new Include("MedicationAdministration.device"); - - /** - * Search parameter constant for encounter - *

- * Description: Return administrations that share this encounter
- * Type: reference
- * Path: MedicationAdministration.encounter
- *

- */ - @SearchParamDefinition(name="encounter", path="MedicationAdministration.encounter", description="Return administrations that share this encounter", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - - /** - * Fluent Client search parameter constant for encounter - *

- * Description: Return administrations that share this encounter
- * Type: reference
- * Path: MedicationAdministration.encounter
- *

- */ - public static final ReferenceClientParam ENCOUNTER = new ReferenceClientParam(SP_ENCOUNTER); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationAdministration.encounter". - */ - public static final Include INCLUDE_ENCOUNTER = new Include("MedicationAdministration.encounter"); - - /** - * Search parameter constant for identifier - *

- * Description: Return administrations with this external identity
- * Type: token
- * Path: MedicationAdministration.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="MedicationAdministration.identifier", description="Return administrations with this external identity", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Return administrations with this external identity
- * Type: token
- * Path: MedicationAdministration.identifier
- *

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

- * Description: Return administrations of this medication
- * Type: reference
- * Path: MedicationAdministration.medication
- *

- */ - @SearchParamDefinition(name="medication", path="MedicationAdministration.medication", description="Return administrations of this medication", type="reference" ) - public static final String SP_MEDICATION = "medication"; - - /** - * Fluent Client search parameter constant for medication - *

- * Description: Return administrations of this medication
- * Type: reference
- * Path: MedicationAdministration.medication
- *

- */ - public static final ReferenceClientParam MEDICATION = new ReferenceClientParam(SP_MEDICATION); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationAdministration.medication". - */ - public static final Include INCLUDE_MEDICATION = new Include("MedicationAdministration.medication"); - - /** - * Search parameter constant for notgiven - *

- * Description: Administrations that were not made
- * Type: token
- * Path: MedicationAdministration.wasNotGiven
- *

- */ - @SearchParamDefinition(name="notgiven", path="MedicationAdministration.wasNotGiven", description="Administrations that were not made", type="token" ) - public static final String SP_NOTGIVEN = "notgiven"; - - /** - * Fluent Client search parameter constant for notgiven - *

- * Description: Administrations that were not made
- * Type: token
- * Path: MedicationAdministration.wasNotGiven
- *

- */ - public static final TokenClientParam NOTGIVEN = new TokenClientParam(SP_NOTGIVEN); - - /** - * Search parameter constant for patient - *

- * Description: The identity of a patient to list administrations for
- * Type: reference
- * Path: MedicationAdministration.patient
- *

- */ - @SearchParamDefinition(name="patient", path="MedicationAdministration.patient", description="The identity of a patient to list administrations for", type="reference" ) - public static final String SP_PATIENT = "patient"; - - /** - * Fluent Client search parameter constant for patient - *

- * Description: The identity of a patient to list administrations for
- * Type: reference
- * Path: MedicationAdministration.patient
- *

- */ - public static final ReferenceClientParam PATIENT = new ReferenceClientParam(SP_PATIENT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationAdministration.patient". - */ - public static final Include INCLUDE_PATIENT = new Include("MedicationAdministration.patient"); - - /** - * Search parameter constant for prescription - *

- * Description: The identity of a prescription to list administrations from
- * Type: reference
- * Path: MedicationAdministration.prescription
- *

- */ - @SearchParamDefinition(name="prescription", path="MedicationAdministration.prescription", description="The identity of a prescription to list administrations from", type="reference" ) - public static final String SP_PRESCRIPTION = "prescription"; - - /** - * Fluent Client search parameter constant for prescription - *

- * Description: The identity of a prescription to list administrations from
- * Type: reference
- * Path: MedicationAdministration.prescription
- *

- */ - public static final ReferenceClientParam PRESCRIPTION = new ReferenceClientParam(SP_PRESCRIPTION); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationAdministration.prescription". - */ - public static final Include INCLUDE_PRESCRIPTION = new Include("MedicationAdministration.prescription"); - - /** - * Search parameter constant for status - *

- * Description: MedicationAdministration event status (for example one of active/paused/completed/nullified)
- * Type: token
- * Path: MedicationAdministration.status
- *

- */ - @SearchParamDefinition(name="status", path="MedicationAdministration.status", description="MedicationAdministration event status (for example one of active/paused/completed/nullified)", type="token" ) - public static final String SP_STATUS = "status"; - - /** - * Fluent Client search parameter constant for status - *

- * Description: MedicationAdministration event status (for example one of active/paused/completed/nullified)
- * Type: token
- * Path: MedicationAdministration.status
- *

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

- * Description: Date of administration
- * Type: date
- * Path: MedicationAdministration.whenGiven
- *

- */ - @SearchParamDefinition(name="whengiven", path="MedicationAdministration.whenGiven", description="Date of administration", type="date" ) - public static final String SP_WHENGIVEN = "whengiven"; - - /** - * Fluent Client search parameter constant for whengiven - *

- * Description: Date of administration
- * Type: date
- * Path: MedicationAdministration.whenGiven
- *

- */ - public static final DateClientParam WHENGIVEN = new DateClientParam(SP_WHENGIVEN); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="External identifier", - formalDefinition="External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated." - ) - private java.util.List myIdentifier; - - @Child(name="status", type=CodeDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="in progress | on hold | completed | entered in error | stopped", - formalDefinition="Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way." - ) - private BoundCodeDt myStatus; - - @Child(name="patient", order=2, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="Who received medication?", - formalDefinition="The person or animal to whom the medication was given." - ) - private ResourceReferenceDt myPatient; - - @Child(name="practitioner", order=3, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class }) - @Description( - shortDefinition="Who administered substance?", - formalDefinition="The individual who was responsible for giving the medication to the patient." - ) - private ResourceReferenceDt myPractitioner; - - @Child(name="encounter", order=4, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Encounter.class }) - @Description( - shortDefinition="Encounter administered as part of", - formalDefinition="The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of." - ) - private ResourceReferenceDt myEncounter; - - @Child(name="prescription", order=5, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.MedicationPrescription.class }) - @Description( - shortDefinition="Order administration performed against", - formalDefinition="The original request, instruction or authority to perform the administration." - ) - private ResourceReferenceDt myPrescription; - - @Child(name="wasNotGiven", type=BooleanDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="True if medication not administered", - formalDefinition="Set this to true if the record is saying that the medication was NOT administered." - ) - private BooleanDt myWasNotGiven; - - @Child(name="reasonNotGiven", type=CodeableConceptDt.class, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Reason administration not performed", - formalDefinition="A code indicating why the administration was not performed." - ) - private java.util.List myReasonNotGiven; - - @Child(name="whenGiven", type=PeriodDt.class, order=8, min=1, max=1) - @Description( - shortDefinition="Start and end time of administration", - formalDefinition="An interval of time during which the administration took place. For many administrations, such as swallowing a tablet the lower and upper values of the interval will be the same." - ) - private PeriodDt myWhenGiven; - - @Child(name="medication", order=9, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Medication.class }) - @Description( - shortDefinition="What was administered?", - formalDefinition="Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications." - ) - private ResourceReferenceDt myMedication; - - @Child(name="device", order=10, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Device.class }) - @Description( - shortDefinition="Device used to administer", - formalDefinition="The device used in administering the medication to the patient. E.g. a particular infusion pump" - ) - private java.util.List myDevice; - - @Child(name="dosage", order=11, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Medicine administration instructions to the patient/carer", - formalDefinition="Provides details of how much of the medication was administered" - ) - private java.util.List myDosage; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myStatus, myPatient, myPractitioner, myEncounter, myPrescription, myWasNotGiven, myReasonNotGiven, myWhenGiven, myMedication, myDevice, myDosage); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myStatus, myPatient, myPractitioner, myEncounter, myPrescription, myWasNotGiven, myReasonNotGiven, myWhenGiven, myMedication, myDevice, myDosage); - } - - /** - * Gets the value(s) for identifier (External identifier). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated. - *

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (External identifier) - * - *

- * Definition: - * External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated. - *

- */ - public MedicationAdministration setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (External identifier) - * - *

- * Definition: - * External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated. - *

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (External identifier), - * creating it if it does not already exist. - * - *

- * Definition: - * External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated. - *

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (External identifier) - * - *

- * Definition: - * External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated. - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public MedicationAdministration addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (External identifier) - * - *

- * Definition: - * External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated. - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public MedicationAdministration addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for status (in progress | on hold | completed | entered in error | stopped). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way. - *

- */ - public BoundCodeDt getStatus() { - if (myStatus == null) { - myStatus = new BoundCodeDt(MedicationAdministrationStatusEnum.VALUESET_BINDER); - } - return myStatus; - } - - /** - * Sets the value(s) for status (in progress | on hold | completed | entered in error | stopped) - * - *

- * Definition: - * Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way. - *

- */ - public MedicationAdministration setStatus(BoundCodeDt theValue) { - myStatus = theValue; - return this; - } - - /** - * Sets the value(s) for status (in progress | on hold | completed | entered in error | stopped) - * - *

- * Definition: - * Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way. - *

- */ - public MedicationAdministration setStatus(MedicationAdministrationStatusEnum theValue) { - getStatus().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for patient (Who received medication?). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The person or animal to whom the medication was given. - *

- */ - public ResourceReferenceDt getPatient() { - if (myPatient == null) { - myPatient = new ResourceReferenceDt(); - } - return myPatient; - } - - /** - * Sets the value(s) for patient (Who received medication?) - * - *

- * Definition: - * The person or animal to whom the medication was given. - *

- */ - public MedicationAdministration setPatient(ResourceReferenceDt theValue) { - myPatient = theValue; - return this; - } - - - /** - * Gets the value(s) for practitioner (Who administered substance?). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The individual who was responsible for giving the medication to the patient. - *

- */ - public ResourceReferenceDt getPractitioner() { - if (myPractitioner == null) { - myPractitioner = new ResourceReferenceDt(); - } - return myPractitioner; - } - - /** - * Sets the value(s) for practitioner (Who administered substance?) - * - *

- * Definition: - * The individual who was responsible for giving the medication to the patient. - *

- */ - public MedicationAdministration setPractitioner(ResourceReferenceDt theValue) { - myPractitioner = theValue; - return this; - } - - - /** - * Gets the value(s) for encounter (Encounter administered as part of). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of. - *

- */ - public ResourceReferenceDt getEncounter() { - if (myEncounter == null) { - myEncounter = new ResourceReferenceDt(); - } - return myEncounter; - } - - /** - * Sets the value(s) for encounter (Encounter administered as part of) - * - *

- * Definition: - * The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of. - *

- */ - public MedicationAdministration setEncounter(ResourceReferenceDt theValue) { - myEncounter = theValue; - return this; - } - - - /** - * Gets the value(s) for prescription (Order administration performed against). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The original request, instruction or authority to perform the administration. - *

- */ - public ResourceReferenceDt getPrescription() { - if (myPrescription == null) { - myPrescription = new ResourceReferenceDt(); - } - return myPrescription; - } - - /** - * Sets the value(s) for prescription (Order administration performed against) - * - *

- * Definition: - * The original request, instruction or authority to perform the administration. - *

- */ - public MedicationAdministration setPrescription(ResourceReferenceDt theValue) { - myPrescription = theValue; - return this; - } - - - /** - * Gets the value(s) for wasNotGiven (True if medication not administered). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Set this to true if the record is saying that the medication was NOT administered. - *

- */ - public BooleanDt getWasNotGiven() { - if (myWasNotGiven == null) { - myWasNotGiven = new BooleanDt(); - } - return myWasNotGiven; - } - - /** - * Sets the value(s) for wasNotGiven (True if medication not administered) - * - *

- * Definition: - * Set this to true if the record is saying that the medication was NOT administered. - *

- */ - public MedicationAdministration setWasNotGiven(BooleanDt theValue) { - myWasNotGiven = theValue; - return this; - } - - /** - * Sets the value for wasNotGiven (True if medication not administered) - * - *

- * Definition: - * Set this to true if the record is saying that the medication was NOT administered. - *

- */ - public MedicationAdministration setWasNotGiven( boolean theBoolean) { - myWasNotGiven = new BooleanDt(theBoolean); - return this; - } - - - /** - * Gets the value(s) for reasonNotGiven (Reason administration not performed). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A code indicating why the administration was not performed. - *

- */ - public java.util.List getReasonNotGiven() { - if (myReasonNotGiven == null) { - myReasonNotGiven = new java.util.ArrayList(); - } - return myReasonNotGiven; - } - - /** - * Sets the value(s) for reasonNotGiven (Reason administration not performed) - * - *

- * Definition: - * A code indicating why the administration was not performed. - *

- */ - public MedicationAdministration setReasonNotGiven(java.util.List theValue) { - myReasonNotGiven = theValue; - return this; - } - - /** - * Adds and returns a new value for reasonNotGiven (Reason administration not performed) - * - *

- * Definition: - * A code indicating why the administration was not performed. - *

- */ - public CodeableConceptDt addReasonNotGiven() { - CodeableConceptDt newType = new CodeableConceptDt(); - getReasonNotGiven().add(newType); - return newType; - } - - /** - * Gets the first repetition for reasonNotGiven (Reason administration not performed), - * creating it if it does not already exist. - * - *

- * Definition: - * A code indicating why the administration was not performed. - *

- */ - public CodeableConceptDt getReasonNotGivenFirstRep() { - if (getReasonNotGiven().isEmpty()) { - return addReasonNotGiven(); - } - return getReasonNotGiven().get(0); - } - - /** - * Gets the value(s) for whenGiven (Start and end time of administration). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * An interval of time during which the administration took place. For many administrations, such as swallowing a tablet the lower and upper values of the interval will be the same. - *

- */ - public PeriodDt getWhenGiven() { - if (myWhenGiven == null) { - myWhenGiven = new PeriodDt(); - } - return myWhenGiven; - } - - /** - * Sets the value(s) for whenGiven (Start and end time of administration) - * - *

- * Definition: - * An interval of time during which the administration took place. For many administrations, such as swallowing a tablet the lower and upper values of the interval will be the same. - *

- */ - public MedicationAdministration setWhenGiven(PeriodDt theValue) { - myWhenGiven = theValue; - return this; - } - - - /** - * Gets the value(s) for medication (What was administered?). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. - *

- */ - public ResourceReferenceDt getMedication() { - if (myMedication == null) { - myMedication = new ResourceReferenceDt(); - } - return myMedication; - } - - /** - * Sets the value(s) for medication (What was administered?) - * - *

- * Definition: - * Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. - *

- */ - public MedicationAdministration setMedication(ResourceReferenceDt theValue) { - myMedication = theValue; - return this; - } - - - /** - * Gets the value(s) for device (Device used to administer). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The device used in administering the medication to the patient. E.g. a particular infusion pump - *

- */ - public java.util.List getDevice() { - if (myDevice == null) { - myDevice = new java.util.ArrayList(); - } - return myDevice; - } - - /** - * Sets the value(s) for device (Device used to administer) - * - *

- * Definition: - * The device used in administering the medication to the patient. E.g. a particular infusion pump - *

- */ - public MedicationAdministration setDevice(java.util.List theValue) { - myDevice = theValue; - return this; - } - - /** - * Adds and returns a new value for device (Device used to administer) - * - *

- * Definition: - * The device used in administering the medication to the patient. E.g. a particular infusion pump - *

- */ - public ResourceReferenceDt addDevice() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getDevice().add(newType); - return newType; - } - - /** - * Gets the value(s) for dosage (Medicine administration instructions to the patient/carer). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Provides details of how much of the medication was administered - *

- */ - public java.util.List getDosage() { - if (myDosage == null) { - myDosage = new java.util.ArrayList(); - } - return myDosage; - } - - /** - * Sets the value(s) for dosage (Medicine administration instructions to the patient/carer) - * - *

- * Definition: - * Provides details of how much of the medication was administered - *

- */ - public MedicationAdministration setDosage(java.util.List theValue) { - myDosage = theValue; - return this; - } - - /** - * Adds and returns a new value for dosage (Medicine administration instructions to the patient/carer) - * - *

- * Definition: - * Provides details of how much of the medication was administered - *

- */ - public Dosage addDosage() { - Dosage newType = new Dosage(); - getDosage().add(newType); - return newType; - } - - /** - * Gets the first repetition for dosage (Medicine administration instructions to the patient/carer), - * creating it if it does not already exist. - * - *

- * Definition: - * Provides details of how much of the medication was administered - *

- */ - public Dosage getDosageFirstRep() { - if (getDosage().isEmpty()) { - return addDosage(); - } - return getDosage().get(0); - } - - /** - * Block class for child element: MedicationAdministration.dosage (Medicine administration instructions to the patient/carer) - * - *

- * Definition: - * Provides details of how much of the medication was administered - *

- */ - @Block() - public static class Dosage extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="timing", order=0, min=0, max=1, type={ - DateTimeDt.class, PeriodDt.class }) - @Description( - shortDefinition="When dose(s) were given", - formalDefinition="The timing schedule for giving the medication to the patient. This may be a single time point (using dateTime) or it may be a start and end dateTime (Period)" - ) - private IDatatype myTiming; - - @Child(name="asNeeded", order=1, min=0, max=1, type={ - BooleanDt.class, CodeableConceptDt.class }) - @Description( - shortDefinition="Take \"as needed\" f(or x)", - formalDefinition="If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication" - ) - private IDatatype myAsNeeded; - - @Child(name="site", type=CodeableConceptDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Body site administered to", - formalDefinition="A coded specification of the anatomic site where the medication first entered the body. E.g. \"left arm\"" - ) - private CodeableConceptDt mySite; - - @Child(name="route", type=CodeableConceptDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Path of substance into body", - formalDefinition="A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. E.g. topical, intravenous, etc." - ) - private CodeableConceptDt myRoute; - - @Child(name="method", type=CodeableConceptDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="How drug was administered", - formalDefinition="A coded value indicating the method by which the medication was introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.Terminologies used often pre-coordinate this term with the route and or form of administration." - ) - private CodeableConceptDt myMethod; - - @Child(name="quantity", type=QuantityDt.class, order=5, min=0, max=1) - @Description( - shortDefinition="Amount administered in one dose", - formalDefinition="The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection." - ) - private QuantityDt myQuantity; - - @Child(name="rate", type=RatioDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="Dose quantity per unit of time", - formalDefinition="Identifies the speed with which the medication was introduced into the patient. Typically the rate for an infusion e.g. 200ml in 2 hours. May also expressed as a rate per unit of time such as 100ml per hour - the duration is then not specified, or is specified in the quantity." - ) - private RatioDt myRate; - - @Child(name="maxDosePerPeriod", type=RatioDt.class, order=7, min=0, max=1) - @Description( - shortDefinition="Total dose that was consumed per unit of time", - formalDefinition="The maximum total quantity of a therapeutic substance that was administered to the patient over the specified period of time. E.g. 1000mg in 24 hours." - ) - private RatioDt myMaxDosePerPeriod; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myTiming, myAsNeeded, mySite, myRoute, myMethod, myQuantity, myRate, myMaxDosePerPeriod); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myTiming, myAsNeeded, mySite, myRoute, myMethod, myQuantity, myRate, myMaxDosePerPeriod); - } - - /** - * Gets the value(s) for timing[x] (When dose(s) were given). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The timing schedule for giving the medication to the patient. This may be a single time point (using dateTime) or it may be a start and end dateTime (Period) - *

- */ - public IDatatype getTiming() { - return myTiming; - } - - /** - * Sets the value(s) for timing[x] (When dose(s) were given) - * - *

- * Definition: - * The timing schedule for giving the medication to the patient. This may be a single time point (using dateTime) or it may be a start and end dateTime (Period) - *

- */ - public Dosage setTiming(IDatatype theValue) { - myTiming = theValue; - return this; - } - - - /** - * Gets the value(s) for asNeeded[x] (Take \"as needed\" f(or x)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication - *

- */ - public IDatatype getAsNeeded() { - return myAsNeeded; - } - - /** - * Sets the value(s) for asNeeded[x] (Take \"as needed\" f(or x)) - * - *

- * Definition: - * If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication - *

- */ - public Dosage setAsNeeded(IDatatype theValue) { - myAsNeeded = theValue; - return this; - } - - - /** - * Gets the value(s) for site (Body site administered to). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A coded specification of the anatomic site where the medication first entered the body. E.g. \"left arm\" - *

- */ - public CodeableConceptDt getSite() { - if (mySite == null) { - mySite = new CodeableConceptDt(); - } - return mySite; - } - - /** - * Sets the value(s) for site (Body site administered to) - * - *

- * Definition: - * A coded specification of the anatomic site where the medication first entered the body. E.g. \"left arm\" - *

- */ - public Dosage setSite(CodeableConceptDt theValue) { - mySite = theValue; - return this; - } - - - /** - * Gets the value(s) for route (Path of substance into body). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. E.g. topical, intravenous, etc. - *

- */ - public CodeableConceptDt getRoute() { - if (myRoute == null) { - myRoute = new CodeableConceptDt(); - } - return myRoute; - } - - /** - * Sets the value(s) for route (Path of substance into body) - * - *

- * Definition: - * A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. E.g. topical, intravenous, etc. - *

- */ - public Dosage setRoute(CodeableConceptDt theValue) { - myRoute = theValue; - return this; - } - - - /** - * Gets the value(s) for method (How drug was administered). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A coded value indicating the method by which the medication was introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.Terminologies used often pre-coordinate this term with the route and or form of administration. - *

- */ - public CodeableConceptDt getMethod() { - if (myMethod == null) { - myMethod = new CodeableConceptDt(); - } - return myMethod; - } - - /** - * Sets the value(s) for method (How drug was administered) - * - *

- * Definition: - * A coded value indicating the method by which the medication was introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.Terminologies used often pre-coordinate this term with the route and or form of administration. - *

- */ - public Dosage setMethod(CodeableConceptDt theValue) { - myMethod = theValue; - return this; - } - - - /** - * Gets the value(s) for quantity (Amount administered in one dose). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection. - *

- */ - public QuantityDt getQuantity() { - if (myQuantity == null) { - myQuantity = new QuantityDt(); - } - return myQuantity; - } - - /** - * Sets the value(s) for quantity (Amount administered in one dose) - * - *

- * Definition: - * The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection. - *

- */ - public Dosage setQuantity(QuantityDt theValue) { - myQuantity = theValue; - return this; - } - - /** - * Sets the value for quantity (Amount administered in one dose) - * - *

- * Definition: - * The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection. - *

- */ - public Dosage setQuantity( QuantityCompararatorEnum theComparator, double theValue, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for quantity (Amount administered in one dose) - * - *

- * Definition: - * The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection. - *

- */ - public Dosage setQuantity( QuantityCompararatorEnum theComparator, long theValue, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for quantity (Amount administered in one dose) - * - *

- * Definition: - * The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection. - *

- */ - public Dosage setQuantity( QuantityCompararatorEnum theComparator, double theValue, String theSystem, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for quantity (Amount administered in one dose) - * - *

- * Definition: - * The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection. - *

- */ - public Dosage setQuantity( QuantityCompararatorEnum theComparator, long theValue, String theSystem, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for quantity (Amount administered in one dose) - * - *

- * Definition: - * The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection. - *

- */ - public Dosage setQuantity( double theValue) { - myQuantity = new QuantityDt(theValue); - return this; - } - - /** - * Sets the value for quantity (Amount administered in one dose) - * - *

- * Definition: - * The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection. - *

- */ - public Dosage setQuantity( long theValue) { - myQuantity = new QuantityDt(theValue); - return this; - } - - - /** - * Gets the value(s) for rate (Dose quantity per unit of time). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the speed with which the medication was introduced into the patient. Typically the rate for an infusion e.g. 200ml in 2 hours. May also expressed as a rate per unit of time such as 100ml per hour - the duration is then not specified, or is specified in the quantity. - *

- */ - public RatioDt getRate() { - if (myRate == null) { - myRate = new RatioDt(); - } - return myRate; - } - - /** - * Sets the value(s) for rate (Dose quantity per unit of time) - * - *

- * Definition: - * Identifies the speed with which the medication was introduced into the patient. Typically the rate for an infusion e.g. 200ml in 2 hours. May also expressed as a rate per unit of time such as 100ml per hour - the duration is then not specified, or is specified in the quantity. - *

- */ - public Dosage setRate(RatioDt theValue) { - myRate = theValue; - return this; - } - - - /** - * Gets the value(s) for maxDosePerPeriod (Total dose that was consumed per unit of time). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The maximum total quantity of a therapeutic substance that was administered to the patient over the specified period of time. E.g. 1000mg in 24 hours. - *

- */ - public RatioDt getMaxDosePerPeriod() { - if (myMaxDosePerPeriod == null) { - myMaxDosePerPeriod = new RatioDt(); - } - return myMaxDosePerPeriod; - } - - /** - * Sets the value(s) for maxDosePerPeriod (Total dose that was consumed per unit of time) - * - *

- * Definition: - * The maximum total quantity of a therapeutic substance that was administered to the patient over the specified period of time. E.g. 1000mg in 24 hours. - *

- */ - public Dosage setMaxDosePerPeriod(RatioDt theValue) { - myMaxDosePerPeriod = theValue; - return this; - } - - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationDispense.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationDispense.java deleted file mode 100644 index b36cd036582..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationDispense.java +++ /dev/null @@ -1,1974 +0,0 @@ - - - - - - - - - - - - - - - - -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.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.RatioDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.composite.ScheduleDt; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.MedicationDispenseStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; -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.rest.gclient.DateClientParam; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR MedicationDispense Resource - * (Dispensing a medication to a named patient) - * - *

- * Definition: - * Dispensing a medication to a named patient. This includes a description of the supply provided and the instructions for administering the medication. - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/MedicationDispense - *

- * - */ -@ResourceDef(name="MedicationDispense", profile="http://hl7.org/fhir/profiles/MedicationDispense", id="medicationdispense") -public class MedicationDispense extends BaseResource implements IResource { - - /** - * Search parameter constant for destination - *

- * Description: Return dispenses that should be sent to a secific destination
- * Type: reference
- * Path: MedicationDispense.dispense.destination
- *

- */ - @SearchParamDefinition(name="destination", path="MedicationDispense.dispense.destination", description="Return dispenses that should be sent to a secific destination", type="reference" ) - public static final String SP_DESTINATION = "destination"; - - /** - * Fluent Client search parameter constant for destination - *

- * Description: Return dispenses that should be sent to a secific destination
- * Type: reference
- * Path: MedicationDispense.dispense.destination
- *

- */ - public static final ReferenceClientParam DESTINATION = new ReferenceClientParam(SP_DESTINATION); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationDispense.dispense.destination". - */ - public static final Include INCLUDE_DISPENSE_DESTINATION = new Include("MedicationDispense.dispense.destination"); - - /** - * Search parameter constant for dispenser - *

- * Description: Return all dispenses performed by a specific indiividual
- * Type: reference
- * Path: MedicationDispense.dispenser
- *

- */ - @SearchParamDefinition(name="dispenser", path="MedicationDispense.dispenser", description="Return all dispenses performed by a specific indiividual", type="reference" ) - public static final String SP_DISPENSER = "dispenser"; - - /** - * Fluent Client search parameter constant for dispenser - *

- * Description: Return all dispenses performed by a specific indiividual
- * Type: reference
- * Path: MedicationDispense.dispenser
- *

- */ - public static final ReferenceClientParam DISPENSER = new ReferenceClientParam(SP_DISPENSER); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationDispense.dispenser". - */ - public static final Include INCLUDE_DISPENSER = new Include("MedicationDispense.dispenser"); - - /** - * Search parameter constant for identifier - *

- * Description: Return dispenses with this external identity
- * Type: token
- * Path: MedicationDispense.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="MedicationDispense.identifier", description="Return dispenses with this external identity", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Return dispenses with this external identity
- * Type: token
- * Path: MedicationDispense.identifier
- *

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

- * Description: Returns dispenses of this medicine
- * Type: reference
- * Path: MedicationDispense.dispense.medication
- *

- */ - @SearchParamDefinition(name="medication", path="MedicationDispense.dispense.medication", description="Returns dispenses of this medicine", type="reference" ) - public static final String SP_MEDICATION = "medication"; - - /** - * Fluent Client search parameter constant for medication - *

- * Description: Returns dispenses of this medicine
- * Type: reference
- * Path: MedicationDispense.dispense.medication
- *

- */ - public static final ReferenceClientParam MEDICATION = new ReferenceClientParam(SP_MEDICATION); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationDispense.dispense.medication". - */ - public static final Include INCLUDE_DISPENSE_MEDICATION = new Include("MedicationDispense.dispense.medication"); - - /** - * Search parameter constant for patient - *

- * Description: The identity of a patient to list dispenses for
- * Type: reference
- * Path: MedicationDispense.patient
- *

- */ - @SearchParamDefinition(name="patient", path="MedicationDispense.patient", description="The identity of a patient to list dispenses for", type="reference" ) - public static final String SP_PATIENT = "patient"; - - /** - * Fluent Client search parameter constant for patient - *

- * Description: The identity of a patient to list dispenses for
- * Type: reference
- * Path: MedicationDispense.patient
- *

- */ - public static final ReferenceClientParam PATIENT = new ReferenceClientParam(SP_PATIENT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationDispense.patient". - */ - public static final Include INCLUDE_PATIENT = new Include("MedicationDispense.patient"); - - /** - * Search parameter constant for prescription - *

- * Description: The identity of a prescription to list dispenses from
- * Type: reference
- * Path: MedicationDispense.authorizingPrescription
- *

- */ - @SearchParamDefinition(name="prescription", path="MedicationDispense.authorizingPrescription", description="The identity of a prescription to list dispenses from", type="reference" ) - public static final String SP_PRESCRIPTION = "prescription"; - - /** - * Fluent Client search parameter constant for prescription - *

- * Description: The identity of a prescription to list dispenses from
- * Type: reference
- * Path: MedicationDispense.authorizingPrescription
- *

- */ - public static final ReferenceClientParam PRESCRIPTION = new ReferenceClientParam(SP_PRESCRIPTION); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationDispense.authorizingPrescription". - */ - public static final Include INCLUDE_AUTHORIZINGPRESCRIPTION = new Include("MedicationDispense.authorizingPrescription"); - - /** - * Search parameter constant for responsibleparty - *

- * Description: Return all dispenses with the specified responsible party
- * Type: reference
- * Path: MedicationDispense.substitution.responsibleParty
- *

- */ - @SearchParamDefinition(name="responsibleparty", path="MedicationDispense.substitution.responsibleParty", description="Return all dispenses with the specified responsible party", type="reference" ) - public static final String SP_RESPONSIBLEPARTY = "responsibleparty"; - - /** - * Fluent Client search parameter constant for responsibleparty - *

- * Description: Return all dispenses with the specified responsible party
- * Type: reference
- * Path: MedicationDispense.substitution.responsibleParty
- *

- */ - public static final ReferenceClientParam RESPONSIBLEPARTY = new ReferenceClientParam(SP_RESPONSIBLEPARTY); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationDispense.substitution.responsibleParty". - */ - public static final Include INCLUDE_SUBSTITUTION_RESPONSIBLEPARTY = new Include("MedicationDispense.substitution.responsibleParty"); - - /** - * Search parameter constant for status - *

- * Description: Status of the dispense
- * Type: token
- * Path: MedicationDispense.dispense.status
- *

- */ - @SearchParamDefinition(name="status", path="MedicationDispense.dispense.status", description="Status of the dispense", type="token" ) - public static final String SP_STATUS = "status"; - - /** - * Fluent Client search parameter constant for status - *

- * Description: Status of the dispense
- * Type: token
- * Path: MedicationDispense.dispense.status
- *

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

- * Description: Return all dispenses of a specific type
- * Type: token
- * Path: MedicationDispense.dispense.type
- *

- */ - @SearchParamDefinition(name="type", path="MedicationDispense.dispense.type", description="Return all dispenses of a specific type", type="token" ) - public static final String SP_TYPE = "type"; - - /** - * Fluent Client search parameter constant for type - *

- * Description: Return all dispenses of a specific type
- * Type: token
- * Path: MedicationDispense.dispense.type
- *

- */ - public static final TokenClientParam TYPE = new TokenClientParam(SP_TYPE); - - /** - * Search parameter constant for whenhandedover - *

- * Description: Date when medication handed over to patient (outpatient setting), or supplied to ward or clinic (inpatient setting)
- * Type: date
- * Path: MedicationDispense.dispense.whenHandedOver
- *

- */ - @SearchParamDefinition(name="whenhandedover", path="MedicationDispense.dispense.whenHandedOver", description="Date when medication handed over to patient (outpatient setting), or supplied to ward or clinic (inpatient setting)", type="date" ) - public static final String SP_WHENHANDEDOVER = "whenhandedover"; - - /** - * Fluent Client search parameter constant for whenhandedover - *

- * Description: Date when medication handed over to patient (outpatient setting), or supplied to ward or clinic (inpatient setting)
- * Type: date
- * Path: MedicationDispense.dispense.whenHandedOver
- *

- */ - public static final DateClientParam WHENHANDEDOVER = new DateClientParam(SP_WHENHANDEDOVER); - - /** - * Search parameter constant for whenprepared - *

- * Description: Date when medication prepared
- * Type: date
- * Path: MedicationDispense.dispense.whenPrepared
- *

- */ - @SearchParamDefinition(name="whenprepared", path="MedicationDispense.dispense.whenPrepared", description="Date when medication prepared", type="date" ) - public static final String SP_WHENPREPARED = "whenprepared"; - - /** - * Fluent Client search parameter constant for whenprepared - *

- * Description: Date when medication prepared
- * Type: date
- * Path: MedicationDispense.dispense.whenPrepared
- *

- */ - public static final DateClientParam WHENPREPARED = new DateClientParam(SP_WHENPREPARED); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="External identifier", - formalDefinition="Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR." - ) - private IdentifierDt myIdentifier; - - @Child(name="status", type=CodeDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="in progress | on hold | completed | entered in error | stopped", - formalDefinition="A code specifying the state of the set of dispense events." - ) - private BoundCodeDt myStatus; - - @Child(name="patient", order=2, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="Who the dispense is for", - formalDefinition="A link to a resource representing the person to whom the medication will be given." - ) - private ResourceReferenceDt myPatient; - - @Child(name="dispenser", order=3, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class }) - @Description( - shortDefinition="Practitioner responsible for dispensing medication", - formalDefinition="The individual responsible for dispensing the medication" - ) - private ResourceReferenceDt myDispenser; - - @Child(name="authorizingPrescription", order=4, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.MedicationPrescription.class }) - @Description( - shortDefinition="Medication order that authorizes the dispense", - formalDefinition="Indicates the medication order that is being dispensed against." - ) - private java.util.List myAuthorizingPrescription; - - @Child(name="dispense", order=5, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Details for individual dispensed medicationdetails", - formalDefinition="Indicates the details of the dispense event such as the days supply and quantity of medication dispensed." - ) - private java.util.List myDispense; - - @Child(name="substitution", order=6, min=0, max=1) - @Description( - shortDefinition="Deals with substitution of one medicine for another", - formalDefinition="Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but doesn't happen, in other cases substitution is not expected but does happen. This block explains what substitition did or did not happen and why." - ) - private Substitution mySubstitution; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myStatus, myPatient, myDispenser, myAuthorizingPrescription, myDispense, mySubstitution); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myStatus, myPatient, myDispenser, myAuthorizingPrescription, myDispense, mySubstitution); - } - - /** - * Gets the value(s) for identifier (External identifier). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR. - *

- */ - public IdentifierDt getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new IdentifierDt(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (External identifier) - * - *

- * Definition: - * Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR. - *

- */ - public MedicationDispense setIdentifier(IdentifierDt theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Sets the value for identifier (External identifier) - * - *

- * Definition: - * Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR. - *

- */ - public MedicationDispense setIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - myIdentifier = new IdentifierDt(theUse, theSystem, theValue, theLabel); - return this; - } - - /** - * Sets the value for identifier (External identifier) - * - *

- * Definition: - * Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR. - *

- */ - public MedicationDispense setIdentifier( String theSystem, String theValue) { - myIdentifier = new IdentifierDt(theSystem, theValue); - return this; - } - - - /** - * Gets the value(s) for status (in progress | on hold | completed | entered in error | stopped). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A code specifying the state of the set of dispense events. - *

- */ - public BoundCodeDt getStatus() { - if (myStatus == null) { - myStatus = new BoundCodeDt(MedicationDispenseStatusEnum.VALUESET_BINDER); - } - return myStatus; - } - - /** - * Sets the value(s) for status (in progress | on hold | completed | entered in error | stopped) - * - *

- * Definition: - * A code specifying the state of the set of dispense events. - *

- */ - public MedicationDispense setStatus(BoundCodeDt theValue) { - myStatus = theValue; - return this; - } - - /** - * Sets the value(s) for status (in progress | on hold | completed | entered in error | stopped) - * - *

- * Definition: - * A code specifying the state of the set of dispense events. - *

- */ - public MedicationDispense setStatus(MedicationDispenseStatusEnum theValue) { - getStatus().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for patient (Who the dispense is for). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A link to a resource representing the person to whom the medication will be given. - *

- */ - public ResourceReferenceDt getPatient() { - if (myPatient == null) { - myPatient = new ResourceReferenceDt(); - } - return myPatient; - } - - /** - * Sets the value(s) for patient (Who the dispense is for) - * - *

- * Definition: - * A link to a resource representing the person to whom the medication will be given. - *

- */ - public MedicationDispense setPatient(ResourceReferenceDt theValue) { - myPatient = theValue; - return this; - } - - - /** - * Gets the value(s) for dispenser (Practitioner responsible for dispensing medication). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The individual responsible for dispensing the medication - *

- */ - public ResourceReferenceDt getDispenser() { - if (myDispenser == null) { - myDispenser = new ResourceReferenceDt(); - } - return myDispenser; - } - - /** - * Sets the value(s) for dispenser (Practitioner responsible for dispensing medication) - * - *

- * Definition: - * The individual responsible for dispensing the medication - *

- */ - public MedicationDispense setDispenser(ResourceReferenceDt theValue) { - myDispenser = theValue; - return this; - } - - - /** - * Gets the value(s) for authorizingPrescription (Medication order that authorizes the dispense). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates the medication order that is being dispensed against. - *

- */ - public java.util.List getAuthorizingPrescription() { - if (myAuthorizingPrescription == null) { - myAuthorizingPrescription = new java.util.ArrayList(); - } - return myAuthorizingPrescription; - } - - /** - * Sets the value(s) for authorizingPrescription (Medication order that authorizes the dispense) - * - *

- * Definition: - * Indicates the medication order that is being dispensed against. - *

- */ - public MedicationDispense setAuthorizingPrescription(java.util.List theValue) { - myAuthorizingPrescription = theValue; - return this; - } - - /** - * Adds and returns a new value for authorizingPrescription (Medication order that authorizes the dispense) - * - *

- * Definition: - * Indicates the medication order that is being dispensed against. - *

- */ - public ResourceReferenceDt addAuthorizingPrescription() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getAuthorizingPrescription().add(newType); - return newType; - } - - /** - * Gets the value(s) for dispense (Details for individual dispensed medicationdetails). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates the details of the dispense event such as the days supply and quantity of medication dispensed. - *

- */ - public java.util.List getDispense() { - if (myDispense == null) { - myDispense = new java.util.ArrayList(); - } - return myDispense; - } - - /** - * Sets the value(s) for dispense (Details for individual dispensed medicationdetails) - * - *

- * Definition: - * Indicates the details of the dispense event such as the days supply and quantity of medication dispensed. - *

- */ - public MedicationDispense setDispense(java.util.List theValue) { - myDispense = theValue; - return this; - } - - /** - * Adds and returns a new value for dispense (Details for individual dispensed medicationdetails) - * - *

- * Definition: - * Indicates the details of the dispense event such as the days supply and quantity of medication dispensed. - *

- */ - public Dispense addDispense() { - Dispense newType = new Dispense(); - getDispense().add(newType); - return newType; - } - - /** - * Gets the first repetition for dispense (Details for individual dispensed medicationdetails), - * creating it if it does not already exist. - * - *

- * Definition: - * Indicates the details of the dispense event such as the days supply and quantity of medication dispensed. - *

- */ - public Dispense getDispenseFirstRep() { - if (getDispense().isEmpty()) { - return addDispense(); - } - return getDispense().get(0); - } - - /** - * Gets the value(s) for substitution (Deals with substitution of one medicine for another). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but doesn't happen, in other cases substitution is not expected but does happen. This block explains what substitition did or did not happen and why. - *

- */ - public Substitution getSubstitution() { - if (mySubstitution == null) { - mySubstitution = new Substitution(); - } - return mySubstitution; - } - - /** - * Sets the value(s) for substitution (Deals with substitution of one medicine for another) - * - *

- * Definition: - * Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but doesn't happen, in other cases substitution is not expected but does happen. This block explains what substitition did or did not happen and why. - *

- */ - public MedicationDispense setSubstitution(Substitution theValue) { - mySubstitution = theValue; - return this; - } - - - /** - * Block class for child element: MedicationDispense.dispense (Details for individual dispensed medicationdetails) - * - *

- * Definition: - * Indicates the details of the dispense event such as the days supply and quantity of medication dispensed. - *

- */ - @Block() - public static class Dispense extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="External identifier for individual item", - formalDefinition="Identifier assigned by the dispensing facility. This is an identifier assigned outside FHIR." - ) - private IdentifierDt myIdentifier; - - @Child(name="status", type=CodeDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="in progress | on hold | completed | entered in error | stopped", - formalDefinition="A code specifying the state of the dispense event." - ) - private BoundCodeDt myStatus; - - @Child(name="type", type=CodeableConceptDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Trial fill, partial fill, emergency fill, etc.", - formalDefinition="Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc." - ) - private CodeableConceptDt myType; - - @Child(name="quantity", type=QuantityDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Amount dispensed", - formalDefinition="The amount of medication that has been dispensed. Includes unit of measure." - ) - private QuantityDt myQuantity; - - @Child(name="medication", order=4, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Medication.class }) - @Description( - shortDefinition="What medication was supplied", - formalDefinition="Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications." - ) - private ResourceReferenceDt myMedication; - - @Child(name="whenPrepared", type=DateTimeDt.class, order=5, min=0, max=1) - @Description( - shortDefinition="Dispense processing time", - formalDefinition="The time when the dispensed product was packaged and reviewed." - ) - private DateTimeDt myWhenPrepared; - - @Child(name="whenHandedOver", type=DateTimeDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="Handover time", - formalDefinition="The time the dispensed product was provided to the patient or their representative." - ) - private DateTimeDt myWhenHandedOver; - - @Child(name="destination", order=7, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Location.class }) - @Description( - shortDefinition="Where the medication was sent", - formalDefinition="Identification of the facility/location where the medication was shipped to, as part of the dispense event." - ) - private ResourceReferenceDt myDestination; - - @Child(name="receiver", order=8, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.Practitioner.class }) - @Description( - shortDefinition="Who collected the medication", - formalDefinition="Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional" - ) - private java.util.List myReceiver; - - @Child(name="dosage", order=9, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Medicine administration instructions to the patient/carer", - formalDefinition="Indicates how the medication is to be used by the patient" - ) - private java.util.List myDosage; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myStatus, myType, myQuantity, myMedication, myWhenPrepared, myWhenHandedOver, myDestination, myReceiver, myDosage); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myStatus, myType, myQuantity, myMedication, myWhenPrepared, myWhenHandedOver, myDestination, myReceiver, myDosage); - } - - /** - * Gets the value(s) for identifier (External identifier for individual item). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifier assigned by the dispensing facility. This is an identifier assigned outside FHIR. - *

- */ - public IdentifierDt getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new IdentifierDt(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (External identifier for individual item) - * - *

- * Definition: - * Identifier assigned by the dispensing facility. This is an identifier assigned outside FHIR. - *

- */ - public Dispense setIdentifier(IdentifierDt theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Sets the value for identifier (External identifier for individual item) - * - *

- * Definition: - * Identifier assigned by the dispensing facility. This is an identifier assigned outside FHIR. - *

- */ - public Dispense setIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - myIdentifier = new IdentifierDt(theUse, theSystem, theValue, theLabel); - return this; - } - - /** - * Sets the value for identifier (External identifier for individual item) - * - *

- * Definition: - * Identifier assigned by the dispensing facility. This is an identifier assigned outside FHIR. - *

- */ - public Dispense setIdentifier( String theSystem, String theValue) { - myIdentifier = new IdentifierDt(theSystem, theValue); - return this; - } - - - /** - * Gets the value(s) for status (in progress | on hold | completed | entered in error | stopped). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A code specifying the state of the dispense event. - *

- */ - public BoundCodeDt getStatus() { - if (myStatus == null) { - myStatus = new BoundCodeDt(MedicationDispenseStatusEnum.VALUESET_BINDER); - } - return myStatus; - } - - /** - * Sets the value(s) for status (in progress | on hold | completed | entered in error | stopped) - * - *

- * Definition: - * A code specifying the state of the dispense event. - *

- */ - public Dispense setStatus(BoundCodeDt theValue) { - myStatus = theValue; - return this; - } - - /** - * Sets the value(s) for status (in progress | on hold | completed | entered in error | stopped) - * - *

- * Definition: - * A code specifying the state of the dispense event. - *

- */ - public Dispense setStatus(MedicationDispenseStatusEnum theValue) { - getStatus().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for type (Trial fill, partial fill, emergency fill, etc.). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc. - *

- */ - public CodeableConceptDt getType() { - if (myType == null) { - myType = new CodeableConceptDt(); - } - return myType; - } - - /** - * Sets the value(s) for type (Trial fill, partial fill, emergency fill, etc.) - * - *

- * Definition: - * Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc. - *

- */ - public Dispense setType(CodeableConceptDt theValue) { - myType = theValue; - return this; - } - - - /** - * Gets the value(s) for quantity (Amount dispensed). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The amount of medication that has been dispensed. Includes unit of measure. - *

- */ - public QuantityDt getQuantity() { - if (myQuantity == null) { - myQuantity = new QuantityDt(); - } - return myQuantity; - } - - /** - * Sets the value(s) for quantity (Amount dispensed) - * - *

- * Definition: - * The amount of medication that has been dispensed. Includes unit of measure. - *

- */ - public Dispense setQuantity(QuantityDt theValue) { - myQuantity = theValue; - return this; - } - - /** - * Sets the value for quantity (Amount dispensed) - * - *

- * Definition: - * The amount of medication that has been dispensed. Includes unit of measure. - *

- */ - public Dispense setQuantity( QuantityCompararatorEnum theComparator, double theValue, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for quantity (Amount dispensed) - * - *

- * Definition: - * The amount of medication that has been dispensed. Includes unit of measure. - *

- */ - public Dispense setQuantity( QuantityCompararatorEnum theComparator, long theValue, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for quantity (Amount dispensed) - * - *

- * Definition: - * The amount of medication that has been dispensed. Includes unit of measure. - *

- */ - public Dispense setQuantity( QuantityCompararatorEnum theComparator, double theValue, String theSystem, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for quantity (Amount dispensed) - * - *

- * Definition: - * The amount of medication that has been dispensed. Includes unit of measure. - *

- */ - public Dispense setQuantity( QuantityCompararatorEnum theComparator, long theValue, String theSystem, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for quantity (Amount dispensed) - * - *

- * Definition: - * The amount of medication that has been dispensed. Includes unit of measure. - *

- */ - public Dispense setQuantity( double theValue) { - myQuantity = new QuantityDt(theValue); - return this; - } - - /** - * Sets the value for quantity (Amount dispensed) - * - *

- * Definition: - * The amount of medication that has been dispensed. Includes unit of measure. - *

- */ - public Dispense setQuantity( long theValue) { - myQuantity = new QuantityDt(theValue); - return this; - } - - - /** - * Gets the value(s) for medication (What medication was supplied). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. - *

- */ - public ResourceReferenceDt getMedication() { - if (myMedication == null) { - myMedication = new ResourceReferenceDt(); - } - return myMedication; - } - - /** - * Sets the value(s) for medication (What medication was supplied) - * - *

- * Definition: - * Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. - *

- */ - public Dispense setMedication(ResourceReferenceDt theValue) { - myMedication = theValue; - return this; - } - - - /** - * Gets the value(s) for whenPrepared (Dispense processing time). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The time when the dispensed product was packaged and reviewed. - *

- */ - public DateTimeDt getWhenPrepared() { - if (myWhenPrepared == null) { - myWhenPrepared = new DateTimeDt(); - } - return myWhenPrepared; - } - - /** - * Sets the value(s) for whenPrepared (Dispense processing time) - * - *

- * Definition: - * The time when the dispensed product was packaged and reviewed. - *

- */ - public Dispense setWhenPrepared(DateTimeDt theValue) { - myWhenPrepared = theValue; - return this; - } - - /** - * Sets the value for whenPrepared (Dispense processing time) - * - *

- * Definition: - * The time when the dispensed product was packaged and reviewed. - *

- */ - public Dispense setWhenPreparedWithSecondsPrecision( Date theDate) { - myWhenPrepared = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for whenPrepared (Dispense processing time) - * - *

- * Definition: - * The time when the dispensed product was packaged and reviewed. - *

- */ - public Dispense setWhenPrepared( Date theDate, TemporalPrecisionEnum thePrecision) { - myWhenPrepared = new DateTimeDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for whenHandedOver (Handover time). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The time the dispensed product was provided to the patient or their representative. - *

- */ - public DateTimeDt getWhenHandedOver() { - if (myWhenHandedOver == null) { - myWhenHandedOver = new DateTimeDt(); - } - return myWhenHandedOver; - } - - /** - * Sets the value(s) for whenHandedOver (Handover time) - * - *

- * Definition: - * The time the dispensed product was provided to the patient or their representative. - *

- */ - public Dispense setWhenHandedOver(DateTimeDt theValue) { - myWhenHandedOver = theValue; - return this; - } - - /** - * Sets the value for whenHandedOver (Handover time) - * - *

- * Definition: - * The time the dispensed product was provided to the patient or their representative. - *

- */ - public Dispense setWhenHandedOverWithSecondsPrecision( Date theDate) { - myWhenHandedOver = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for whenHandedOver (Handover time) - * - *

- * Definition: - * The time the dispensed product was provided to the patient or their representative. - *

- */ - public Dispense setWhenHandedOver( Date theDate, TemporalPrecisionEnum thePrecision) { - myWhenHandedOver = new DateTimeDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for destination (Where the medication was sent). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identification of the facility/location where the medication was shipped to, as part of the dispense event. - *

- */ - public ResourceReferenceDt getDestination() { - if (myDestination == null) { - myDestination = new ResourceReferenceDt(); - } - return myDestination; - } - - /** - * Sets the value(s) for destination (Where the medication was sent) - * - *

- * Definition: - * Identification of the facility/location where the medication was shipped to, as part of the dispense event. - *

- */ - public Dispense setDestination(ResourceReferenceDt theValue) { - myDestination = theValue; - return this; - } - - - /** - * Gets the value(s) for receiver (Who collected the medication). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional - *

- */ - public java.util.List getReceiver() { - if (myReceiver == null) { - myReceiver = new java.util.ArrayList(); - } - return myReceiver; - } - - /** - * Sets the value(s) for receiver (Who collected the medication) - * - *

- * Definition: - * Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional - *

- */ - public Dispense setReceiver(java.util.List theValue) { - myReceiver = theValue; - return this; - } - - /** - * Adds and returns a new value for receiver (Who collected the medication) - * - *

- * Definition: - * Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional - *

- */ - public ResourceReferenceDt addReceiver() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getReceiver().add(newType); - return newType; - } - - /** - * Gets the value(s) for dosage (Medicine administration instructions to the patient/carer). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates how the medication is to be used by the patient - *

- */ - public java.util.List getDosage() { - if (myDosage == null) { - myDosage = new java.util.ArrayList(); - } - return myDosage; - } - - /** - * Sets the value(s) for dosage (Medicine administration instructions to the patient/carer) - * - *

- * Definition: - * Indicates how the medication is to be used by the patient - *

- */ - public Dispense setDosage(java.util.List theValue) { - myDosage = theValue; - return this; - } - - /** - * Adds and returns a new value for dosage (Medicine administration instructions to the patient/carer) - * - *

- * Definition: - * Indicates how the medication is to be used by the patient - *

- */ - public DispenseDosage addDosage() { - DispenseDosage newType = new DispenseDosage(); - getDosage().add(newType); - return newType; - } - - /** - * Gets the first repetition for dosage (Medicine administration instructions to the patient/carer), - * creating it if it does not already exist. - * - *

- * Definition: - * Indicates how the medication is to be used by the patient - *

- */ - public DispenseDosage getDosageFirstRep() { - if (getDosage().isEmpty()) { - return addDosage(); - } - return getDosage().get(0); - } - - - } - - /** - * Block class for child element: MedicationDispense.dispense.dosage (Medicine administration instructions to the patient/carer) - * - *

- * Definition: - * Indicates how the medication is to be used by the patient - *

- */ - @Block() - public static class DispenseDosage extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="additionalInstructions", type=CodeableConceptDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="E.g. \"Take with food\"", - formalDefinition="Additional instructions such as \"Swallow with plenty of water\" which may or may not be coded." - ) - private CodeableConceptDt myAdditionalInstructions; - - @Child(name="timing", order=1, min=0, max=1, type={ - DateTimeDt.class, PeriodDt.class, ScheduleDt.class }) - @Description( - shortDefinition="When medication should be administered", - formalDefinition="The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\"" - ) - private IDatatype myTiming; - - @Child(name="asNeeded", order=2, min=0, max=1, type={ - BooleanDt.class, CodeableConceptDt.class }) - @Description( - shortDefinition="Take \"as needed\" f(or x)", - formalDefinition="If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication" - ) - private IDatatype myAsNeeded; - - @Child(name="site", type=CodeableConceptDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Body site to administer to", - formalDefinition="A coded specification of the anatomic site where the medication first enters the body" - ) - private CodeableConceptDt mySite; - - @Child(name="route", type=CodeableConceptDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="How drug should enter body", - formalDefinition="A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject." - ) - private CodeableConceptDt myRoute; - - @Child(name="method", type=CodeableConceptDt.class, order=5, min=0, max=1) - @Description( - shortDefinition="Technique for administering medication", - formalDefinition="A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.Terminologies used often pre-coordinate this term with the route and or form of administration." - ) - private CodeableConceptDt myMethod; - - @Child(name="quantity", type=QuantityDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="Amount of medication per dose", - formalDefinition="The amount of therapeutic or other substance given at one administration event." - ) - private QuantityDt myQuantity; - - @Child(name="rate", type=RatioDt.class, order=7, min=0, max=1) - @Description( - shortDefinition="Amount of medication per unit of time", - formalDefinition="Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours." - ) - private RatioDt myRate; - - @Child(name="maxDosePerPeriod", type=RatioDt.class, order=8, min=0, max=1) - @Description( - shortDefinition="Upper limit on medication per unit of time", - formalDefinition="The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time, e.g. 1000mg in 24 hours." - ) - private RatioDt myMaxDosePerPeriod; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myAdditionalInstructions, myTiming, myAsNeeded, mySite, myRoute, myMethod, myQuantity, myRate, myMaxDosePerPeriod); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myAdditionalInstructions, myTiming, myAsNeeded, mySite, myRoute, myMethod, myQuantity, myRate, myMaxDosePerPeriod); - } - - /** - * Gets the value(s) for additionalInstructions (E.g. \"Take with food\"). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Additional instructions such as \"Swallow with plenty of water\" which may or may not be coded. - *

- */ - public CodeableConceptDt getAdditionalInstructions() { - if (myAdditionalInstructions == null) { - myAdditionalInstructions = new CodeableConceptDt(); - } - return myAdditionalInstructions; - } - - /** - * Sets the value(s) for additionalInstructions (E.g. \"Take with food\") - * - *

- * Definition: - * Additional instructions such as \"Swallow with plenty of water\" which may or may not be coded. - *

- */ - public DispenseDosage setAdditionalInstructions(CodeableConceptDt theValue) { - myAdditionalInstructions = theValue; - return this; - } - - - /** - * Gets the value(s) for timing[x] (When medication should be administered). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\" - *

- */ - public IDatatype getTiming() { - return myTiming; - } - - /** - * Sets the value(s) for timing[x] (When medication should be administered) - * - *

- * Definition: - * The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\" - *

- */ - public DispenseDosage setTiming(IDatatype theValue) { - myTiming = theValue; - return this; - } - - - /** - * Gets the value(s) for asNeeded[x] (Take \"as needed\" f(or x)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication - *

- */ - public IDatatype getAsNeeded() { - return myAsNeeded; - } - - /** - * Sets the value(s) for asNeeded[x] (Take \"as needed\" f(or x)) - * - *

- * Definition: - * If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication - *

- */ - public DispenseDosage setAsNeeded(IDatatype theValue) { - myAsNeeded = theValue; - return this; - } - - - /** - * Gets the value(s) for site (Body site to administer to). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A coded specification of the anatomic site where the medication first enters the body - *

- */ - public CodeableConceptDt getSite() { - if (mySite == null) { - mySite = new CodeableConceptDt(); - } - return mySite; - } - - /** - * Sets the value(s) for site (Body site to administer to) - * - *

- * Definition: - * A coded specification of the anatomic site where the medication first enters the body - *

- */ - public DispenseDosage setSite(CodeableConceptDt theValue) { - mySite = theValue; - return this; - } - - - /** - * Gets the value(s) for route (How drug should enter body). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject. - *

- */ - public CodeableConceptDt getRoute() { - if (myRoute == null) { - myRoute = new CodeableConceptDt(); - } - return myRoute; - } - - /** - * Sets the value(s) for route (How drug should enter body) - * - *

- * Definition: - * A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject. - *

- */ - public DispenseDosage setRoute(CodeableConceptDt theValue) { - myRoute = theValue; - return this; - } - - - /** - * Gets the value(s) for method (Technique for administering medication). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.Terminologies used often pre-coordinate this term with the route and or form of administration. - *

- */ - public CodeableConceptDt getMethod() { - if (myMethod == null) { - myMethod = new CodeableConceptDt(); - } - return myMethod; - } - - /** - * Sets the value(s) for method (Technique for administering medication) - * - *

- * Definition: - * A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.Terminologies used often pre-coordinate this term with the route and or form of administration. - *

- */ - public DispenseDosage setMethod(CodeableConceptDt theValue) { - myMethod = theValue; - return this; - } - - - /** - * Gets the value(s) for quantity (Amount of medication per dose). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The amount of therapeutic or other substance given at one administration event. - *

- */ - public QuantityDt getQuantity() { - if (myQuantity == null) { - myQuantity = new QuantityDt(); - } - return myQuantity; - } - - /** - * Sets the value(s) for quantity (Amount of medication per dose) - * - *

- * Definition: - * The amount of therapeutic or other substance given at one administration event. - *

- */ - public DispenseDosage setQuantity(QuantityDt theValue) { - myQuantity = theValue; - return this; - } - - /** - * Sets the value for quantity (Amount of medication per dose) - * - *

- * Definition: - * The amount of therapeutic or other substance given at one administration event. - *

- */ - public DispenseDosage setQuantity( QuantityCompararatorEnum theComparator, double theValue, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for quantity (Amount of medication per dose) - * - *

- * Definition: - * The amount of therapeutic or other substance given at one administration event. - *

- */ - public DispenseDosage setQuantity( QuantityCompararatorEnum theComparator, long theValue, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for quantity (Amount of medication per dose) - * - *

- * Definition: - * The amount of therapeutic or other substance given at one administration event. - *

- */ - public DispenseDosage setQuantity( QuantityCompararatorEnum theComparator, double theValue, String theSystem, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for quantity (Amount of medication per dose) - * - *

- * Definition: - * The amount of therapeutic or other substance given at one administration event. - *

- */ - public DispenseDosage setQuantity( QuantityCompararatorEnum theComparator, long theValue, String theSystem, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for quantity (Amount of medication per dose) - * - *

- * Definition: - * The amount of therapeutic or other substance given at one administration event. - *

- */ - public DispenseDosage setQuantity( double theValue) { - myQuantity = new QuantityDt(theValue); - return this; - } - - /** - * Sets the value for quantity (Amount of medication per dose) - * - *

- * Definition: - * The amount of therapeutic or other substance given at one administration event. - *

- */ - public DispenseDosage setQuantity( long theValue) { - myQuantity = new QuantityDt(theValue); - return this; - } - - - /** - * Gets the value(s) for rate (Amount of medication per unit of time). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours. - *

- */ - public RatioDt getRate() { - if (myRate == null) { - myRate = new RatioDt(); - } - return myRate; - } - - /** - * Sets the value(s) for rate (Amount of medication per unit of time) - * - *

- * Definition: - * Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours. - *

- */ - public DispenseDosage setRate(RatioDt theValue) { - myRate = theValue; - return this; - } - - - /** - * Gets the value(s) for maxDosePerPeriod (Upper limit on medication per unit of time). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time, e.g. 1000mg in 24 hours. - *

- */ - public RatioDt getMaxDosePerPeriod() { - if (myMaxDosePerPeriod == null) { - myMaxDosePerPeriod = new RatioDt(); - } - return myMaxDosePerPeriod; - } - - /** - * Sets the value(s) for maxDosePerPeriod (Upper limit on medication per unit of time) - * - *

- * Definition: - * The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time, e.g. 1000mg in 24 hours. - *

- */ - public DispenseDosage setMaxDosePerPeriod(RatioDt theValue) { - myMaxDosePerPeriod = theValue; - return this; - } - - - - } - - - - /** - * Block class for child element: MedicationDispense.substitution (Deals with substitution of one medicine for another) - * - *

- * Definition: - * Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but doesn't happen, in other cases substitution is not expected but does happen. This block explains what substitition did or did not happen and why. - *

- */ - @Block() - public static class Substitution extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="type", type=CodeableConceptDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Type of substitiution", - formalDefinition="A code signifying whether a different drug was dispensed from what was prescribed." - ) - private CodeableConceptDt myType; - - @Child(name="reason", type=CodeableConceptDt.class, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Why was substitution made", - formalDefinition="Indicates the reason for the substitution of (or lack of substitution) from what was prescribed." - ) - private java.util.List myReason; - - @Child(name="responsibleParty", order=2, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class }) - @Description( - shortDefinition="Who is responsible for the substitution", - formalDefinition="The person or organization that has primary responsibility for the substitution" - ) - private java.util.List myResponsibleParty; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myType, myReason, myResponsibleParty); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myType, myReason, myResponsibleParty); - } - - /** - * Gets the value(s) for type (Type of substitiution). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A code signifying whether a different drug was dispensed from what was prescribed. - *

- */ - public CodeableConceptDt getType() { - if (myType == null) { - myType = new CodeableConceptDt(); - } - return myType; - } - - /** - * Sets the value(s) for type (Type of substitiution) - * - *

- * Definition: - * A code signifying whether a different drug was dispensed from what was prescribed. - *

- */ - public Substitution setType(CodeableConceptDt theValue) { - myType = theValue; - return this; - } - - - /** - * Gets the value(s) for reason (Why was substitution made). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates the reason for the substitution of (or lack of substitution) from what was prescribed. - *

- */ - public java.util.List getReason() { - if (myReason == null) { - myReason = new java.util.ArrayList(); - } - return myReason; - } - - /** - * Sets the value(s) for reason (Why was substitution made) - * - *

- * Definition: - * Indicates the reason for the substitution of (or lack of substitution) from what was prescribed. - *

- */ - public Substitution setReason(java.util.List theValue) { - myReason = theValue; - return this; - } - - /** - * Adds and returns a new value for reason (Why was substitution made) - * - *

- * Definition: - * Indicates the reason for the substitution of (or lack of substitution) from what was prescribed. - *

- */ - public CodeableConceptDt addReason() { - CodeableConceptDt newType = new CodeableConceptDt(); - getReason().add(newType); - return newType; - } - - /** - * Gets the first repetition for reason (Why was substitution made), - * creating it if it does not already exist. - * - *

- * Definition: - * Indicates the reason for the substitution of (or lack of substitution) from what was prescribed. - *

- */ - public CodeableConceptDt getReasonFirstRep() { - if (getReason().isEmpty()) { - return addReason(); - } - return getReason().get(0); - } - - /** - * Gets the value(s) for responsibleParty (Who is responsible for the substitution). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The person or organization that has primary responsibility for the substitution - *

- */ - public java.util.List getResponsibleParty() { - if (myResponsibleParty == null) { - myResponsibleParty = new java.util.ArrayList(); - } - return myResponsibleParty; - } - - /** - * Sets the value(s) for responsibleParty (Who is responsible for the substitution) - * - *

- * Definition: - * The person or organization that has primary responsibility for the substitution - *

- */ - public Substitution setResponsibleParty(java.util.List theValue) { - myResponsibleParty = theValue; - return this; - } - - /** - * Adds and returns a new value for responsibleParty (Who is responsible for the substitution) - * - *

- * Definition: - * The person or organization that has primary responsibility for the substitution - *

- */ - public ResourceReferenceDt addResponsibleParty() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getResponsibleParty().add(newType); - return newType; - } - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationPrescription.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationPrescription.java deleted file mode 100644 index 73f9ab52588..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationPrescription.java +++ /dev/null @@ -1,1715 +0,0 @@ - - - - - - - - - - - - - - - - -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.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.DurationDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.RatioDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.composite.ScheduleDt; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.MedicationPrescriptionStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; -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.IntegerDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.rest.gclient.DateClientParam; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR MedicationPrescription Resource - * (Prescription of medication to for patient) - * - *

- * Definition: - * An order for both supply of the medication and the instructions for administration of the medicine to a patient. - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/MedicationPrescription - *

- * - */ -@ResourceDef(name="MedicationPrescription", profile="http://hl7.org/fhir/profiles/MedicationPrescription", id="medicationprescription") -public class MedicationPrescription extends BaseResource implements IResource { - - /** - * Search parameter constant for datewritten - *

- * Description: Return prescriptions written on this date
- * Type: date
- * Path: MedicationPrescription.dateWritten
- *

- */ - @SearchParamDefinition(name="datewritten", path="MedicationPrescription.dateWritten", description="Return prescriptions written on this date", type="date" ) - public static final String SP_DATEWRITTEN = "datewritten"; - - /** - * Fluent Client search parameter constant for datewritten - *

- * Description: Return prescriptions written on this date
- * Type: date
- * Path: MedicationPrescription.dateWritten
- *

- */ - public static final DateClientParam DATEWRITTEN = new DateClientParam(SP_DATEWRITTEN); - - /** - * Search parameter constant for encounter - *

- * Description: Return prescriptions with this encounter identity
- * Type: reference
- * Path: MedicationPrescription.encounter
- *

- */ - @SearchParamDefinition(name="encounter", path="MedicationPrescription.encounter", description="Return prescriptions with this encounter identity", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - - /** - * Fluent Client search parameter constant for encounter - *

- * Description: Return prescriptions with this encounter identity
- * Type: reference
- * Path: MedicationPrescription.encounter
- *

- */ - public static final ReferenceClientParam ENCOUNTER = new ReferenceClientParam(SP_ENCOUNTER); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationPrescription.encounter". - */ - public static final Include INCLUDE_ENCOUNTER = new Include("MedicationPrescription.encounter"); - - /** - * Search parameter constant for identifier - *

- * Description: Return prescriptions with this external identity
- * Type: token
- * Path: MedicationPrescription.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="MedicationPrescription.identifier", description="Return prescriptions with this external identity", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Return prescriptions with this external identity
- * Type: token
- * Path: MedicationPrescription.identifier
- *

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

- * Description: Code for medicine or text in medicine name
- * Type: reference
- * Path: MedicationPrescription.medication
- *

- */ - @SearchParamDefinition(name="medication", path="MedicationPrescription.medication", description="Code for medicine or text in medicine name", type="reference" ) - public static final String SP_MEDICATION = "medication"; - - /** - * Fluent Client search parameter constant for medication - *

- * Description: Code for medicine or text in medicine name
- * Type: reference
- * Path: MedicationPrescription.medication
- *

- */ - public static final ReferenceClientParam MEDICATION = new ReferenceClientParam(SP_MEDICATION); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationPrescription.medication". - */ - public static final Include INCLUDE_MEDICATION = new Include("MedicationPrescription.medication"); - - /** - * Search parameter constant for patient - *

- * Description: The identity of a patient to list dispenses for
- * Type: reference
- * Path: MedicationPrescription.patient
- *

- */ - @SearchParamDefinition(name="patient", path="MedicationPrescription.patient", description="The identity of a patient to list dispenses for", type="reference" ) - public static final String SP_PATIENT = "patient"; - - /** - * Fluent Client search parameter constant for patient - *

- * Description: The identity of a patient to list dispenses for
- * Type: reference
- * Path: MedicationPrescription.patient
- *

- */ - public static final ReferenceClientParam PATIENT = new ReferenceClientParam(SP_PATIENT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationPrescription.patient". - */ - public static final Include INCLUDE_PATIENT = new Include("MedicationPrescription.patient"); - - /** - * Search parameter constant for status - *

- * Description: Status of the prescription
- * Type: token
- * Path: MedicationPrescription.status
- *

- */ - @SearchParamDefinition(name="status", path="MedicationPrescription.status", description="Status of the prescription", type="token" ) - public static final String SP_STATUS = "status"; - - /** - * Fluent Client search parameter constant for status - *

- * Description: Status of the prescription
- * Type: token
- * Path: MedicationPrescription.status
- *

- */ - public static final TokenClientParam STATUS = new TokenClientParam(SP_STATUS); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="External identifier", - formalDefinition="External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system." - ) - private java.util.List myIdentifier; - - @Child(name="dateWritten", type=DateTimeDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="When prescription was authorized", - formalDefinition="The date (and perhaps time) when the prescription was written" - ) - private DateTimeDt myDateWritten; - - @Child(name="status", type=CodeDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="active | on hold | completed | entered in error | stopped | superceded", - formalDefinition="A code specifying the state of the order. Generally this will be active or completed state" - ) - private BoundCodeDt myStatus; - - @Child(name="patient", order=3, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="Who prescription is for", - formalDefinition="A link to a resource representing the person to whom the medication will be given." - ) - private ResourceReferenceDt myPatient; - - @Child(name="prescriber", order=4, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class }) - @Description( - shortDefinition="Who ordered the medication(s)", - formalDefinition="The healthcare professional responsible for authorizing the prescription" - ) - private ResourceReferenceDt myPrescriber; - - @Child(name="encounter", order=5, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Encounter.class }) - @Description( - shortDefinition="Created during encounter / admission / stay", - formalDefinition="A link to a resource that identifies the particular occurrence of contact between patient and health care provider." - ) - private ResourceReferenceDt myEncounter; - - @Child(name="reason", order=6, min=0, max=1, type={ - CodeableConceptDt.class, Condition.class }) - @Description( - shortDefinition="Reason or indication for writing the prescription", - formalDefinition="Can be the reason or the indication for writing the prescription." - ) - private IDatatype myReason; - - @Child(name="medication", order=7, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Medication.class }) - @Description( - shortDefinition="Medication to be taken", - formalDefinition="Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications." - ) - private ResourceReferenceDt myMedication; - - @Child(name="dosageInstruction", order=8, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="How medication should be taken", - formalDefinition="Indicates how the medication is to be used by the patient" - ) - private java.util.List myDosageInstruction; - - @Child(name="dispense", order=9, min=0, max=1) - @Description( - shortDefinition="Medication supply authorization", - formalDefinition="Deals with details of the dispense part of the order" - ) - private Dispense myDispense; - - @Child(name="substitution", order=10, min=0, max=1) - @Description( - shortDefinition="Any restrictions on medication substitution?", - formalDefinition="Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done." - ) - private Substitution mySubstitution; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myDateWritten, myStatus, myPatient, myPrescriber, myEncounter, myReason, myMedication, myDosageInstruction, myDispense, mySubstitution); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myDateWritten, myStatus, myPatient, myPrescriber, myEncounter, myReason, myMedication, myDosageInstruction, myDispense, mySubstitution); - } - - /** - * Gets the value(s) for identifier (External identifier). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system. - *

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (External identifier) - * - *

- * Definition: - * External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system. - *

- */ - public MedicationPrescription setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (External identifier) - * - *

- * Definition: - * External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system. - *

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (External identifier), - * creating it if it does not already exist. - * - *

- * Definition: - * External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system. - *

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (External identifier) - * - *

- * Definition: - * External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system. - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public MedicationPrescription addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (External identifier) - * - *

- * Definition: - * External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system. - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public MedicationPrescription addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for dateWritten (When prescription was authorized). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The date (and perhaps time) when the prescription was written - *

- */ - public DateTimeDt getDateWritten() { - if (myDateWritten == null) { - myDateWritten = new DateTimeDt(); - } - return myDateWritten; - } - - /** - * Sets the value(s) for dateWritten (When prescription was authorized) - * - *

- * Definition: - * The date (and perhaps time) when the prescription was written - *

- */ - public MedicationPrescription setDateWritten(DateTimeDt theValue) { - myDateWritten = theValue; - return this; - } - - /** - * Sets the value for dateWritten (When prescription was authorized) - * - *

- * Definition: - * The date (and perhaps time) when the prescription was written - *

- */ - public MedicationPrescription setDateWrittenWithSecondsPrecision( Date theDate) { - myDateWritten = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for dateWritten (When prescription was authorized) - * - *

- * Definition: - * The date (and perhaps time) when the prescription was written - *

- */ - public MedicationPrescription setDateWritten( Date theDate, TemporalPrecisionEnum thePrecision) { - myDateWritten = new DateTimeDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for status (active | on hold | completed | entered in error | stopped | superceded). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A code specifying the state of the order. Generally this will be active or completed state - *

- */ - public BoundCodeDt getStatus() { - if (myStatus == null) { - myStatus = new BoundCodeDt(MedicationPrescriptionStatusEnum.VALUESET_BINDER); - } - return myStatus; - } - - /** - * Sets the value(s) for status (active | on hold | completed | entered in error | stopped | superceded) - * - *

- * Definition: - * A code specifying the state of the order. Generally this will be active or completed state - *

- */ - public MedicationPrescription setStatus(BoundCodeDt theValue) { - myStatus = theValue; - return this; - } - - /** - * Sets the value(s) for status (active | on hold | completed | entered in error | stopped | superceded) - * - *

- * Definition: - * A code specifying the state of the order. Generally this will be active or completed state - *

- */ - public MedicationPrescription setStatus(MedicationPrescriptionStatusEnum theValue) { - getStatus().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for patient (Who prescription is for). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A link to a resource representing the person to whom the medication will be given. - *

- */ - public ResourceReferenceDt getPatient() { - if (myPatient == null) { - myPatient = new ResourceReferenceDt(); - } - return myPatient; - } - - /** - * Sets the value(s) for patient (Who prescription is for) - * - *

- * Definition: - * A link to a resource representing the person to whom the medication will be given. - *

- */ - public MedicationPrescription setPatient(ResourceReferenceDt theValue) { - myPatient = theValue; - return this; - } - - - /** - * Gets the value(s) for prescriber (Who ordered the medication(s)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The healthcare professional responsible for authorizing the prescription - *

- */ - public ResourceReferenceDt getPrescriber() { - if (myPrescriber == null) { - myPrescriber = new ResourceReferenceDt(); - } - return myPrescriber; - } - - /** - * Sets the value(s) for prescriber (Who ordered the medication(s)) - * - *

- * Definition: - * The healthcare professional responsible for authorizing the prescription - *

- */ - public MedicationPrescription setPrescriber(ResourceReferenceDt theValue) { - myPrescriber = theValue; - return this; - } - - - /** - * Gets the value(s) for encounter (Created during encounter / admission / stay). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A link to a resource that identifies the particular occurrence of contact between patient and health care provider. - *

- */ - public ResourceReferenceDt getEncounter() { - if (myEncounter == null) { - myEncounter = new ResourceReferenceDt(); - } - return myEncounter; - } - - /** - * Sets the value(s) for encounter (Created during encounter / admission / stay) - * - *

- * Definition: - * A link to a resource that identifies the particular occurrence of contact between patient and health care provider. - *

- */ - public MedicationPrescription setEncounter(ResourceReferenceDt theValue) { - myEncounter = theValue; - return this; - } - - - /** - * Gets the value(s) for reason[x] (Reason or indication for writing the prescription). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Can be the reason or the indication for writing the prescription. - *

- */ - public IDatatype getReason() { - return myReason; - } - - /** - * Sets the value(s) for reason[x] (Reason or indication for writing the prescription) - * - *

- * Definition: - * Can be the reason or the indication for writing the prescription. - *

- */ - public MedicationPrescription setReason(IDatatype theValue) { - myReason = theValue; - return this; - } - - - /** - * Gets the value(s) for medication (Medication to be taken). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. - *

- */ - public ResourceReferenceDt getMedication() { - if (myMedication == null) { - myMedication = new ResourceReferenceDt(); - } - return myMedication; - } - - /** - * Sets the value(s) for medication (Medication to be taken) - * - *

- * Definition: - * Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. - *

- */ - public MedicationPrescription setMedication(ResourceReferenceDt theValue) { - myMedication = theValue; - return this; - } - - - /** - * Gets the value(s) for dosageInstruction (How medication should be taken). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates how the medication is to be used by the patient - *

- */ - public java.util.List getDosageInstruction() { - if (myDosageInstruction == null) { - myDosageInstruction = new java.util.ArrayList(); - } - return myDosageInstruction; - } - - /** - * Sets the value(s) for dosageInstruction (How medication should be taken) - * - *

- * Definition: - * Indicates how the medication is to be used by the patient - *

- */ - public MedicationPrescription setDosageInstruction(java.util.List theValue) { - myDosageInstruction = theValue; - return this; - } - - /** - * Adds and returns a new value for dosageInstruction (How medication should be taken) - * - *

- * Definition: - * Indicates how the medication is to be used by the patient - *

- */ - public DosageInstruction addDosageInstruction() { - DosageInstruction newType = new DosageInstruction(); - getDosageInstruction().add(newType); - return newType; - } - - /** - * Gets the first repetition for dosageInstruction (How medication should be taken), - * creating it if it does not already exist. - * - *

- * Definition: - * Indicates how the medication is to be used by the patient - *

- */ - public DosageInstruction getDosageInstructionFirstRep() { - if (getDosageInstruction().isEmpty()) { - return addDosageInstruction(); - } - return getDosageInstruction().get(0); - } - - /** - * Gets the value(s) for dispense (Medication supply authorization). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Deals with details of the dispense part of the order - *

- */ - public Dispense getDispense() { - if (myDispense == null) { - myDispense = new Dispense(); - } - return myDispense; - } - - /** - * Sets the value(s) for dispense (Medication supply authorization) - * - *

- * Definition: - * Deals with details of the dispense part of the order - *

- */ - public MedicationPrescription setDispense(Dispense theValue) { - myDispense = theValue; - return this; - } - - - /** - * Gets the value(s) for substitution (Any restrictions on medication substitution?). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done. - *

- */ - public Substitution getSubstitution() { - if (mySubstitution == null) { - mySubstitution = new Substitution(); - } - return mySubstitution; - } - - /** - * Sets the value(s) for substitution (Any restrictions on medication substitution?) - * - *

- * Definition: - * Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done. - *

- */ - public MedicationPrescription setSubstitution(Substitution theValue) { - mySubstitution = theValue; - return this; - } - - - /** - * Block class for child element: MedicationPrescription.dosageInstruction (How medication should be taken) - * - *

- * Definition: - * Indicates how the medication is to be used by the patient - *

- */ - @Block() - public static class DosageInstruction extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="text", type=StringDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Dosage instructions expressed as text", - formalDefinition="Free text dosage instructions for cases where the instructions are too complex to code." - ) - private StringDt myText; - - @Child(name="additionalInstructions", type=CodeableConceptDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Supplemental instructions - e.g. \"with meals\"", - formalDefinition="Additional instructions such as \"Swallow with plenty of water\" which may or may not be coded." - ) - private CodeableConceptDt myAdditionalInstructions; - - @Child(name="timing", order=2, min=0, max=1, type={ - DateTimeDt.class, PeriodDt.class, ScheduleDt.class }) - @Description( - shortDefinition="When medication should be administered", - formalDefinition="The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\"" - ) - private IDatatype myTiming; - - @Child(name="asNeeded", order=3, min=0, max=1, type={ - BooleanDt.class, CodeableConceptDt.class }) - @Description( - shortDefinition="Take \"as needed\" f(or x)", - formalDefinition="If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication" - ) - private IDatatype myAsNeeded; - - @Child(name="site", type=CodeableConceptDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="Body site to administer to", - formalDefinition="A coded specification of the anatomic site where the medication first enters the body" - ) - private CodeableConceptDt mySite; - - @Child(name="route", type=CodeableConceptDt.class, order=5, min=0, max=1) - @Description( - shortDefinition="How drug should enter body", - formalDefinition="A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient." - ) - private CodeableConceptDt myRoute; - - @Child(name="method", type=CodeableConceptDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="Technique for administering medication", - formalDefinition="A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.Terminologies used often pre-coordinate this term with the route and or form of administration." - ) - private CodeableConceptDt myMethod; - - @Child(name="doseQuantity", type=QuantityDt.class, order=7, min=0, max=1) - @Description( - shortDefinition="Amount of medication per dose", - formalDefinition="The amount of therapeutic or other substance given at one administration event." - ) - private QuantityDt myDoseQuantity; - - @Child(name="rate", type=RatioDt.class, order=8, min=0, max=1) - @Description( - shortDefinition="Amount of medication per unit of time", - formalDefinition="Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours." - ) - private RatioDt myRate; - - @Child(name="maxDosePerPeriod", type=RatioDt.class, order=9, min=0, max=1) - @Description( - shortDefinition="Upper limit on medication per unit of time", - formalDefinition="The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours." - ) - private RatioDt myMaxDosePerPeriod; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myText, myAdditionalInstructions, myTiming, myAsNeeded, mySite, myRoute, myMethod, myDoseQuantity, myRate, myMaxDosePerPeriod); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myText, myAdditionalInstructions, myTiming, myAsNeeded, mySite, myRoute, myMethod, myDoseQuantity, myRate, myMaxDosePerPeriod); - } - - /** - * Gets the value(s) for text (Dosage instructions expressed as text). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Free text dosage instructions for cases where the instructions are too complex to code. - *

- */ - public StringDt getText() { - if (myText == null) { - myText = new StringDt(); - } - return myText; - } - - /** - * Sets the value(s) for text (Dosage instructions expressed as text) - * - *

- * Definition: - * Free text dosage instructions for cases where the instructions are too complex to code. - *

- */ - public DosageInstruction setText(StringDt theValue) { - myText = theValue; - return this; - } - - /** - * Sets the value for text (Dosage instructions expressed as text) - * - *

- * Definition: - * Free text dosage instructions for cases where the instructions are too complex to code. - *

- */ - public DosageInstruction setText( String theString) { - myText = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for additionalInstructions (Supplemental instructions - e.g. \"with meals\"). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Additional instructions such as \"Swallow with plenty of water\" which may or may not be coded. - *

- */ - public CodeableConceptDt getAdditionalInstructions() { - if (myAdditionalInstructions == null) { - myAdditionalInstructions = new CodeableConceptDt(); - } - return myAdditionalInstructions; - } - - /** - * Sets the value(s) for additionalInstructions (Supplemental instructions - e.g. \"with meals\") - * - *

- * Definition: - * Additional instructions such as \"Swallow with plenty of water\" which may or may not be coded. - *

- */ - public DosageInstruction setAdditionalInstructions(CodeableConceptDt theValue) { - myAdditionalInstructions = theValue; - return this; - } - - - /** - * Gets the value(s) for timing[x] (When medication should be administered). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\" - *

- */ - public IDatatype getTiming() { - return myTiming; - } - - /** - * Sets the value(s) for timing[x] (When medication should be administered) - * - *

- * Definition: - * The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\" - *

- */ - public DosageInstruction setTiming(IDatatype theValue) { - myTiming = theValue; - return this; - } - - - /** - * Gets the value(s) for asNeeded[x] (Take \"as needed\" f(or x)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication - *

- */ - public IDatatype getAsNeeded() { - return myAsNeeded; - } - - /** - * Sets the value(s) for asNeeded[x] (Take \"as needed\" f(or x)) - * - *

- * Definition: - * If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication - *

- */ - public DosageInstruction setAsNeeded(IDatatype theValue) { - myAsNeeded = theValue; - return this; - } - - - /** - * Gets the value(s) for site (Body site to administer to). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A coded specification of the anatomic site where the medication first enters the body - *

- */ - public CodeableConceptDt getSite() { - if (mySite == null) { - mySite = new CodeableConceptDt(); - } - return mySite; - } - - /** - * Sets the value(s) for site (Body site to administer to) - * - *

- * Definition: - * A coded specification of the anatomic site where the medication first enters the body - *

- */ - public DosageInstruction setSite(CodeableConceptDt theValue) { - mySite = theValue; - return this; - } - - - /** - * Gets the value(s) for route (How drug should enter body). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient. - *

- */ - public CodeableConceptDt getRoute() { - if (myRoute == null) { - myRoute = new CodeableConceptDt(); - } - return myRoute; - } - - /** - * Sets the value(s) for route (How drug should enter body) - * - *

- * Definition: - * A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient. - *

- */ - public DosageInstruction setRoute(CodeableConceptDt theValue) { - myRoute = theValue; - return this; - } - - - /** - * Gets the value(s) for method (Technique for administering medication). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.Terminologies used often pre-coordinate this term with the route and or form of administration. - *

- */ - public CodeableConceptDt getMethod() { - if (myMethod == null) { - myMethod = new CodeableConceptDt(); - } - return myMethod; - } - - /** - * Sets the value(s) for method (Technique for administering medication) - * - *

- * Definition: - * A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.Terminologies used often pre-coordinate this term with the route and or form of administration. - *

- */ - public DosageInstruction setMethod(CodeableConceptDt theValue) { - myMethod = theValue; - return this; - } - - - /** - * Gets the value(s) for doseQuantity (Amount of medication per dose). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The amount of therapeutic or other substance given at one administration event. - *

- */ - public QuantityDt getDoseQuantity() { - if (myDoseQuantity == null) { - myDoseQuantity = new QuantityDt(); - } - return myDoseQuantity; - } - - /** - * Sets the value(s) for doseQuantity (Amount of medication per dose) - * - *

- * Definition: - * The amount of therapeutic or other substance given at one administration event. - *

- */ - public DosageInstruction setDoseQuantity(QuantityDt theValue) { - myDoseQuantity = theValue; - return this; - } - - /** - * Sets the value for doseQuantity (Amount of medication per dose) - * - *

- * Definition: - * The amount of therapeutic or other substance given at one administration event. - *

- */ - public DosageInstruction setDoseQuantity( QuantityCompararatorEnum theComparator, double theValue, String theUnits) { - myDoseQuantity = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for doseQuantity (Amount of medication per dose) - * - *

- * Definition: - * The amount of therapeutic or other substance given at one administration event. - *

- */ - public DosageInstruction setDoseQuantity( QuantityCompararatorEnum theComparator, long theValue, String theUnits) { - myDoseQuantity = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for doseQuantity (Amount of medication per dose) - * - *

- * Definition: - * The amount of therapeutic or other substance given at one administration event. - *

- */ - public DosageInstruction setDoseQuantity( QuantityCompararatorEnum theComparator, double theValue, String theSystem, String theUnits) { - myDoseQuantity = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for doseQuantity (Amount of medication per dose) - * - *

- * Definition: - * The amount of therapeutic or other substance given at one administration event. - *

- */ - public DosageInstruction setDoseQuantity( QuantityCompararatorEnum theComparator, long theValue, String theSystem, String theUnits) { - myDoseQuantity = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for doseQuantity (Amount of medication per dose) - * - *

- * Definition: - * The amount of therapeutic or other substance given at one administration event. - *

- */ - public DosageInstruction setDoseQuantity( double theValue) { - myDoseQuantity = new QuantityDt(theValue); - return this; - } - - /** - * Sets the value for doseQuantity (Amount of medication per dose) - * - *

- * Definition: - * The amount of therapeutic or other substance given at one administration event. - *

- */ - public DosageInstruction setDoseQuantity( long theValue) { - myDoseQuantity = new QuantityDt(theValue); - return this; - } - - - /** - * Gets the value(s) for rate (Amount of medication per unit of time). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours. - *

- */ - public RatioDt getRate() { - if (myRate == null) { - myRate = new RatioDt(); - } - return myRate; - } - - /** - * Sets the value(s) for rate (Amount of medication per unit of time) - * - *

- * Definition: - * Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours. - *

- */ - public DosageInstruction setRate(RatioDt theValue) { - myRate = theValue; - return this; - } - - - /** - * Gets the value(s) for maxDosePerPeriod (Upper limit on medication per unit of time). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours. - *

- */ - public RatioDt getMaxDosePerPeriod() { - if (myMaxDosePerPeriod == null) { - myMaxDosePerPeriod = new RatioDt(); - } - return myMaxDosePerPeriod; - } - - /** - * Sets the value(s) for maxDosePerPeriod (Upper limit on medication per unit of time) - * - *

- * Definition: - * The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours. - *

- */ - public DosageInstruction setMaxDosePerPeriod(RatioDt theValue) { - myMaxDosePerPeriod = theValue; - return this; - } - - - - } - - - /** - * Block class for child element: MedicationPrescription.dispense (Medication supply authorization) - * - *

- * Definition: - * Deals with details of the dispense part of the order - *

- */ - @Block() - public static class Dispense extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="medication", order=0, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Medication.class }) - @Description( - shortDefinition="Product to be supplied", - formalDefinition="Identifies the medication that is to be dispensed. This may be a more specifically defined than the medicationPrescription.medication . This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications." - ) - private ResourceReferenceDt myMedication; - - @Child(name="validityPeriod", type=PeriodDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Time period supply is authorized for", - formalDefinition="Design Comments: This indicates the validity period of a prescription (stale dating the Prescription) It reflects the prescriber perspective for the validity of the prescription. Dispenses must not be made against the prescription outside of this period. The lower-bound of the Dispensing Window signifies the earliest date that the prescription can be filled for the first time. If an upper-bound is not specified then the Prescription is open-ended or will default to a stale-date based on regulations. Rationale: Indicates when the Prescription becomes valid, and when it ceases to be a dispensable Prescription." - ) - private PeriodDt myValidityPeriod; - - @Child(name="numberOfRepeatsAllowed", type=IntegerDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="# of refills authorized", - formalDefinition="An integer indicating the number of repeats of the Dispense. UsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill." - ) - private IntegerDt myNumberOfRepeatsAllowed; - - @Child(name="quantity", type=QuantityDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Amount of medication to supply per dispense", - formalDefinition="The amount that is to be dispensed." - ) - private QuantityDt myQuantity; - - @Child(name="expectedSupplyDuration", type=DurationDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="Days supply per dispense", - formalDefinition="Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last. In some situations, this attribute may be used instead of quantity to identify the amount supplied by how long it is expected to last, rather than the physical quantity issued, e.g. 90 days supply of medication (based on an ordered dosage) When possible, it is always better to specify quantity, as this tends to be more precise. expectedSupplyDuration will always be an estimate that can be influenced by external factors." - ) - private DurationDt myExpectedSupplyDuration; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myMedication, myValidityPeriod, myNumberOfRepeatsAllowed, myQuantity, myExpectedSupplyDuration); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myMedication, myValidityPeriod, myNumberOfRepeatsAllowed, myQuantity, myExpectedSupplyDuration); - } - - /** - * Gets the value(s) for medication (Product to be supplied). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the medication that is to be dispensed. This may be a more specifically defined than the medicationPrescription.medication . This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. - *

- */ - public ResourceReferenceDt getMedication() { - if (myMedication == null) { - myMedication = new ResourceReferenceDt(); - } - return myMedication; - } - - /** - * Sets the value(s) for medication (Product to be supplied) - * - *

- * Definition: - * Identifies the medication that is to be dispensed. This may be a more specifically defined than the medicationPrescription.medication . This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. - *

- */ - public Dispense setMedication(ResourceReferenceDt theValue) { - myMedication = theValue; - return this; - } - - - /** - * Gets the value(s) for validityPeriod (Time period supply is authorized for). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Design Comments: This indicates the validity period of a prescription (stale dating the Prescription) It reflects the prescriber perspective for the validity of the prescription. Dispenses must not be made against the prescription outside of this period. The lower-bound of the Dispensing Window signifies the earliest date that the prescription can be filled for the first time. If an upper-bound is not specified then the Prescription is open-ended or will default to a stale-date based on regulations. Rationale: Indicates when the Prescription becomes valid, and when it ceases to be a dispensable Prescription. - *

- */ - public PeriodDt getValidityPeriod() { - if (myValidityPeriod == null) { - myValidityPeriod = new PeriodDt(); - } - return myValidityPeriod; - } - - /** - * Sets the value(s) for validityPeriod (Time period supply is authorized for) - * - *

- * Definition: - * Design Comments: This indicates the validity period of a prescription (stale dating the Prescription) It reflects the prescriber perspective for the validity of the prescription. Dispenses must not be made against the prescription outside of this period. The lower-bound of the Dispensing Window signifies the earliest date that the prescription can be filled for the first time. If an upper-bound is not specified then the Prescription is open-ended or will default to a stale-date based on regulations. Rationale: Indicates when the Prescription becomes valid, and when it ceases to be a dispensable Prescription. - *

- */ - public Dispense setValidityPeriod(PeriodDt theValue) { - myValidityPeriod = theValue; - return this; - } - - - /** - * Gets the value(s) for numberOfRepeatsAllowed (# of refills authorized). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * An integer indicating the number of repeats of the Dispense. UsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill. - *

- */ - public IntegerDt getNumberOfRepeatsAllowed() { - if (myNumberOfRepeatsAllowed == null) { - myNumberOfRepeatsAllowed = new IntegerDt(); - } - return myNumberOfRepeatsAllowed; - } - - /** - * Sets the value(s) for numberOfRepeatsAllowed (# of refills authorized) - * - *

- * Definition: - * An integer indicating the number of repeats of the Dispense. UsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill. - *

- */ - public Dispense setNumberOfRepeatsAllowed(IntegerDt theValue) { - myNumberOfRepeatsAllowed = theValue; - return this; - } - - /** - * Sets the value for numberOfRepeatsAllowed (# of refills authorized) - * - *

- * Definition: - * An integer indicating the number of repeats of the Dispense. UsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill. - *

- */ - public Dispense setNumberOfRepeatsAllowed( int theInteger) { - myNumberOfRepeatsAllowed = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for quantity (Amount of medication to supply per dispense). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The amount that is to be dispensed. - *

- */ - public QuantityDt getQuantity() { - if (myQuantity == null) { - myQuantity = new QuantityDt(); - } - return myQuantity; - } - - /** - * Sets the value(s) for quantity (Amount of medication to supply per dispense) - * - *

- * Definition: - * The amount that is to be dispensed. - *

- */ - public Dispense setQuantity(QuantityDt theValue) { - myQuantity = theValue; - return this; - } - - /** - * Sets the value for quantity (Amount of medication to supply per dispense) - * - *

- * Definition: - * The amount that is to be dispensed. - *

- */ - public Dispense setQuantity( QuantityCompararatorEnum theComparator, double theValue, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for quantity (Amount of medication to supply per dispense) - * - *

- * Definition: - * The amount that is to be dispensed. - *

- */ - public Dispense setQuantity( QuantityCompararatorEnum theComparator, long theValue, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for quantity (Amount of medication to supply per dispense) - * - *

- * Definition: - * The amount that is to be dispensed. - *

- */ - public Dispense setQuantity( QuantityCompararatorEnum theComparator, double theValue, String theSystem, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for quantity (Amount of medication to supply per dispense) - * - *

- * Definition: - * The amount that is to be dispensed. - *

- */ - public Dispense setQuantity( QuantityCompararatorEnum theComparator, long theValue, String theSystem, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for quantity (Amount of medication to supply per dispense) - * - *

- * Definition: - * The amount that is to be dispensed. - *

- */ - public Dispense setQuantity( double theValue) { - myQuantity = new QuantityDt(theValue); - return this; - } - - /** - * Sets the value for quantity (Amount of medication to supply per dispense) - * - *

- * Definition: - * The amount that is to be dispensed. - *

- */ - public Dispense setQuantity( long theValue) { - myQuantity = new QuantityDt(theValue); - return this; - } - - - /** - * Gets the value(s) for expectedSupplyDuration (Days supply per dispense). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last. In some situations, this attribute may be used instead of quantity to identify the amount supplied by how long it is expected to last, rather than the physical quantity issued, e.g. 90 days supply of medication (based on an ordered dosage) When possible, it is always better to specify quantity, as this tends to be more precise. expectedSupplyDuration will always be an estimate that can be influenced by external factors. - *

- */ - public DurationDt getExpectedSupplyDuration() { - if (myExpectedSupplyDuration == null) { - myExpectedSupplyDuration = new DurationDt(); - } - return myExpectedSupplyDuration; - } - - /** - * Sets the value(s) for expectedSupplyDuration (Days supply per dispense) - * - *

- * Definition: - * Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last. In some situations, this attribute may be used instead of quantity to identify the amount supplied by how long it is expected to last, rather than the physical quantity issued, e.g. 90 days supply of medication (based on an ordered dosage) When possible, it is always better to specify quantity, as this tends to be more precise. expectedSupplyDuration will always be an estimate that can be influenced by external factors. - *

- */ - public Dispense setExpectedSupplyDuration(DurationDt theValue) { - myExpectedSupplyDuration = theValue; - return this; - } - - - - } - - - /** - * Block class for child element: MedicationPrescription.substitution (Any restrictions on medication substitution?) - * - *

- * Definition: - * Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done. - *

- */ - @Block() - public static class Substitution extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="type", type=CodeableConceptDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="generic | formulary +", - formalDefinition="A code signifying whether a different drug should be dispensed from what was prescribed." - ) - private CodeableConceptDt myType; - - @Child(name="reason", type=CodeableConceptDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Why should substitution (not) be made", - formalDefinition="Indicates the reason for the substitution, or why substitution must or must not be performed." - ) - private CodeableConceptDt myReason; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myType, myReason); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myType, myReason); - } - - /** - * Gets the value(s) for type (generic | formulary +). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A code signifying whether a different drug should be dispensed from what was prescribed. - *

- */ - public CodeableConceptDt getType() { - if (myType == null) { - myType = new CodeableConceptDt(); - } - return myType; - } - - /** - * Sets the value(s) for type (generic | formulary +) - * - *

- * Definition: - * A code signifying whether a different drug should be dispensed from what was prescribed. - *

- */ - public Substitution setType(CodeableConceptDt theValue) { - myType = theValue; - return this; - } - - - /** - * Gets the value(s) for reason (Why should substitution (not) be made). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates the reason for the substitution, or why substitution must or must not be performed. - *

- */ - public CodeableConceptDt getReason() { - if (myReason == null) { - myReason = new CodeableConceptDt(); - } - return myReason; - } - - /** - * Sets the value(s) for reason (Why should substitution (not) be made) - * - *

- * Definition: - * Indicates the reason for the substitution, or why substitution must or must not be performed. - *

- */ - public Substitution setReason(CodeableConceptDt theValue) { - myReason = theValue; - return this; - } - - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationStatement.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationStatement.java deleted file mode 100644 index 5e6641b2ac8..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationStatement.java +++ /dev/null @@ -1,1091 +0,0 @@ - - - - - - - - - - - - - - - - -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.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.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.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.RatioDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.composite.ScheduleDt; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; -import ca.uhn.fhir.model.primitive.BooleanDt; -import ca.uhn.fhir.rest.gclient.DateClientParam; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR MedicationStatement Resource - * (Administration of medication to a patient) - * - *

- * Definition: - * A record of medication being taken by a patient, or that the medication has been given to a patient where the record is the result of a report from the patient or another clinician - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/MedicationStatement - *

- * - */ -@ResourceDef(name="MedicationStatement", profile="http://hl7.org/fhir/profiles/MedicationStatement", id="medicationstatement") -public class MedicationStatement extends BaseResource implements IResource { - - /** - * Search parameter constant for device - *

- * Description: Return administrations with this administration device identity
- * Type: reference
- * Path: MedicationStatement.device
- *

- */ - @SearchParamDefinition(name="device", path="MedicationStatement.device", description="Return administrations with this administration device identity", type="reference" ) - public static final String SP_DEVICE = "device"; - - /** - * Fluent Client search parameter constant for device - *

- * Description: Return administrations with this administration device identity
- * Type: reference
- * Path: MedicationStatement.device
- *

- */ - public static final ReferenceClientParam DEVICE = new ReferenceClientParam(SP_DEVICE); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationStatement.device". - */ - public static final Include INCLUDE_DEVICE = new Include("MedicationStatement.device"); - - /** - * Search parameter constant for identifier - *

- * Description: Return administrations with this external identity
- * Type: token
- * Path: MedicationStatement.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="MedicationStatement.identifier", description="Return administrations with this external identity", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Return administrations with this external identity
- * Type: token
- * Path: MedicationStatement.identifier
- *

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

- * Description: Code for medicine or text in medicine name
- * Type: reference
- * Path: MedicationStatement.medication
- *

- */ - @SearchParamDefinition(name="medication", path="MedicationStatement.medication", description="Code for medicine or text in medicine name", type="reference" ) - public static final String SP_MEDICATION = "medication"; - - /** - * Fluent Client search parameter constant for medication - *

- * Description: Code for medicine or text in medicine name
- * Type: reference
- * Path: MedicationStatement.medication
- *

- */ - public static final ReferenceClientParam MEDICATION = new ReferenceClientParam(SP_MEDICATION); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationStatement.medication". - */ - public static final Include INCLUDE_MEDICATION = new Include("MedicationStatement.medication"); - - /** - * Search parameter constant for patient - *

- * Description: The identity of a patient to list administrations for
- * Type: reference
- * Path: MedicationStatement.patient
- *

- */ - @SearchParamDefinition(name="patient", path="MedicationStatement.patient", description="The identity of a patient to list administrations for", type="reference" ) - public static final String SP_PATIENT = "patient"; - - /** - * Fluent Client search parameter constant for patient - *

- * Description: The identity of a patient to list administrations for
- * Type: reference
- * Path: MedicationStatement.patient
- *

- */ - public static final ReferenceClientParam PATIENT = new ReferenceClientParam(SP_PATIENT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationStatement.patient". - */ - public static final Include INCLUDE_PATIENT = new Include("MedicationStatement.patient"); - - /** - * Search parameter constant for when-given - *

- * Description: Date of administration
- * Type: date
- * Path: MedicationStatement.whenGiven
- *

- */ - @SearchParamDefinition(name="when-given", path="MedicationStatement.whenGiven", description="Date of administration", type="date" ) - public static final String SP_WHEN_GIVEN = "when-given"; - - /** - * Fluent Client search parameter constant for when-given - *

- * Description: Date of administration
- * Type: date
- * Path: MedicationStatement.whenGiven
- *

- */ - public static final DateClientParam WHEN_GIVEN = new DateClientParam(SP_WHEN_GIVEN); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="External Identifier", - formalDefinition="External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated." - ) - private java.util.List myIdentifier; - - @Child(name="patient", order=1, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="Who was/is taking medication", - formalDefinition="The person or animal who is /was taking the medication." - ) - private ResourceReferenceDt myPatient; - - @Child(name="wasNotGiven", type=BooleanDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="True if medication is/was not being taken", - formalDefinition="Set this to true if the record is saying that the medication was NOT taken." - ) - private BooleanDt myWasNotGiven; - - @Child(name="reasonNotGiven", type=CodeableConceptDt.class, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="True if asserting medication was not given", - formalDefinition="A code indicating why the medication was not taken." - ) - private java.util.List myReasonNotGiven; - - @Child(name="whenGiven", type=PeriodDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="Over what period was medication consumed?", - formalDefinition="The interval of time during which it is being asserted that the patient was taking the medication." - ) - private PeriodDt myWhenGiven; - - @Child(name="medication", order=5, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Medication.class }) - @Description( - shortDefinition="What medication was taken?", - formalDefinition="Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications." - ) - private ResourceReferenceDt myMedication; - - @Child(name="device", order=6, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Device.class }) - @Description( - shortDefinition="E.g. infusion pump", - formalDefinition="An identifier or a link to a resource that identifies a device used in administering the medication to the patient." - ) - private java.util.List myDevice; - - @Child(name="dosage", order=7, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Details of how medication was taken", - formalDefinition="Indicates how the medication is/was used by the patient" - ) - private java.util.List myDosage; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myPatient, myWasNotGiven, myReasonNotGiven, myWhenGiven, myMedication, myDevice, myDosage); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myPatient, myWasNotGiven, myReasonNotGiven, myWhenGiven, myMedication, myDevice, myDosage); - } - - /** - * Gets the value(s) for identifier (External Identifier). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated. - *

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (External Identifier) - * - *

- * Definition: - * External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated. - *

- */ - public MedicationStatement setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (External Identifier) - * - *

- * Definition: - * External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated. - *

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (External Identifier), - * creating it if it does not already exist. - * - *

- * Definition: - * External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated. - *

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (External Identifier) - * - *

- * Definition: - * External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated. - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public MedicationStatement addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (External Identifier) - * - *

- * Definition: - * External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated. - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public MedicationStatement addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for patient (Who was/is taking medication). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The person or animal who is /was taking the medication. - *

- */ - public ResourceReferenceDt getPatient() { - if (myPatient == null) { - myPatient = new ResourceReferenceDt(); - } - return myPatient; - } - - /** - * Sets the value(s) for patient (Who was/is taking medication) - * - *

- * Definition: - * The person or animal who is /was taking the medication. - *

- */ - public MedicationStatement setPatient(ResourceReferenceDt theValue) { - myPatient = theValue; - return this; - } - - - /** - * Gets the value(s) for wasNotGiven (True if medication is/was not being taken). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Set this to true if the record is saying that the medication was NOT taken. - *

- */ - public BooleanDt getWasNotGiven() { - if (myWasNotGiven == null) { - myWasNotGiven = new BooleanDt(); - } - return myWasNotGiven; - } - - /** - * Sets the value(s) for wasNotGiven (True if medication is/was not being taken) - * - *

- * Definition: - * Set this to true if the record is saying that the medication was NOT taken. - *

- */ - public MedicationStatement setWasNotGiven(BooleanDt theValue) { - myWasNotGiven = theValue; - return this; - } - - /** - * Sets the value for wasNotGiven (True if medication is/was not being taken) - * - *

- * Definition: - * Set this to true if the record is saying that the medication was NOT taken. - *

- */ - public MedicationStatement setWasNotGiven( boolean theBoolean) { - myWasNotGiven = new BooleanDt(theBoolean); - return this; - } - - - /** - * Gets the value(s) for reasonNotGiven (True if asserting medication was not given). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A code indicating why the medication was not taken. - *

- */ - public java.util.List getReasonNotGiven() { - if (myReasonNotGiven == null) { - myReasonNotGiven = new java.util.ArrayList(); - } - return myReasonNotGiven; - } - - /** - * Sets the value(s) for reasonNotGiven (True if asserting medication was not given) - * - *

- * Definition: - * A code indicating why the medication was not taken. - *

- */ - public MedicationStatement setReasonNotGiven(java.util.List theValue) { - myReasonNotGiven = theValue; - return this; - } - - /** - * Adds and returns a new value for reasonNotGiven (True if asserting medication was not given) - * - *

- * Definition: - * A code indicating why the medication was not taken. - *

- */ - public CodeableConceptDt addReasonNotGiven() { - CodeableConceptDt newType = new CodeableConceptDt(); - getReasonNotGiven().add(newType); - return newType; - } - - /** - * Gets the first repetition for reasonNotGiven (True if asserting medication was not given), - * creating it if it does not already exist. - * - *

- * Definition: - * A code indicating why the medication was not taken. - *

- */ - public CodeableConceptDt getReasonNotGivenFirstRep() { - if (getReasonNotGiven().isEmpty()) { - return addReasonNotGiven(); - } - return getReasonNotGiven().get(0); - } - - /** - * Gets the value(s) for whenGiven (Over what period was medication consumed?). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The interval of time during which it is being asserted that the patient was taking the medication. - *

- */ - public PeriodDt getWhenGiven() { - if (myWhenGiven == null) { - myWhenGiven = new PeriodDt(); - } - return myWhenGiven; - } - - /** - * Sets the value(s) for whenGiven (Over what period was medication consumed?) - * - *

- * Definition: - * The interval of time during which it is being asserted that the patient was taking the medication. - *

- */ - public MedicationStatement setWhenGiven(PeriodDt theValue) { - myWhenGiven = theValue; - return this; - } - - - /** - * Gets the value(s) for medication (What medication was taken?). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. - *

- */ - public ResourceReferenceDt getMedication() { - if (myMedication == null) { - myMedication = new ResourceReferenceDt(); - } - return myMedication; - } - - /** - * Sets the value(s) for medication (What medication was taken?) - * - *

- * Definition: - * Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. - *

- */ - public MedicationStatement setMedication(ResourceReferenceDt theValue) { - myMedication = theValue; - return this; - } - - - /** - * Gets the value(s) for device (E.g. infusion pump). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * An identifier or a link to a resource that identifies a device used in administering the medication to the patient. - *

- */ - public java.util.List getDevice() { - if (myDevice == null) { - myDevice = new java.util.ArrayList(); - } - return myDevice; - } - - /** - * Sets the value(s) for device (E.g. infusion pump) - * - *

- * Definition: - * An identifier or a link to a resource that identifies a device used in administering the medication to the patient. - *

- */ - public MedicationStatement setDevice(java.util.List theValue) { - myDevice = theValue; - return this; - } - - /** - * Adds and returns a new value for device (E.g. infusion pump) - * - *

- * Definition: - * An identifier or a link to a resource that identifies a device used in administering the medication to the patient. - *

- */ - public ResourceReferenceDt addDevice() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getDevice().add(newType); - return newType; - } - - /** - * Gets the value(s) for dosage (Details of how medication was taken). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates how the medication is/was used by the patient - *

- */ - public java.util.List getDosage() { - if (myDosage == null) { - myDosage = new java.util.ArrayList(); - } - return myDosage; - } - - /** - * Sets the value(s) for dosage (Details of how medication was taken) - * - *

- * Definition: - * Indicates how the medication is/was used by the patient - *

- */ - public MedicationStatement setDosage(java.util.List theValue) { - myDosage = theValue; - return this; - } - - /** - * Adds and returns a new value for dosage (Details of how medication was taken) - * - *

- * Definition: - * Indicates how the medication is/was used by the patient - *

- */ - public Dosage addDosage() { - Dosage newType = new Dosage(); - getDosage().add(newType); - return newType; - } - - /** - * Gets the first repetition for dosage (Details of how medication was taken), - * creating it if it does not already exist. - * - *

- * Definition: - * Indicates how the medication is/was used by the patient - *

- */ - public Dosage getDosageFirstRep() { - if (getDosage().isEmpty()) { - return addDosage(); - } - return getDosage().get(0); - } - - /** - * Block class for child element: MedicationStatement.dosage (Details of how medication was taken) - * - *

- * Definition: - * Indicates how the medication is/was used by the patient - *

- */ - @Block() - public static class Dosage extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="timing", type=ScheduleDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="When/how often was medication taken?", - formalDefinition="The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\"" - ) - private ScheduleDt myTiming; - - @Child(name="asNeeded", order=1, min=0, max=1, type={ - BooleanDt.class, CodeableConceptDt.class }) - @Description( - shortDefinition="Take \"as needed\" f(or x)", - formalDefinition="If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication" - ) - private IDatatype myAsNeeded; - - @Child(name="site", type=CodeableConceptDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Where on body was medication administered?", - formalDefinition="A coded specification of the anatomic site where the medication first enters the body" - ) - private CodeableConceptDt mySite; - - @Child(name="route", type=CodeableConceptDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="How did the medication enter the body?", - formalDefinition="A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject." - ) - private CodeableConceptDt myRoute; - - @Child(name="method", type=CodeableConceptDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="Technique used to administer medication", - formalDefinition="A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.Terminologies used often pre-coordinate this term with the route and or form of administration." - ) - private CodeableConceptDt myMethod; - - @Child(name="quantity", type=QuantityDt.class, order=5, min=0, max=1) - @Description( - shortDefinition="Amount administered in one dose", - formalDefinition="The amount of therapeutic or other substance given at one administration event." - ) - private QuantityDt myQuantity; - - @Child(name="rate", type=RatioDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="Dose quantity per unit of time", - formalDefinition="Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours." - ) - private RatioDt myRate; - - @Child(name="maxDosePerPeriod", type=RatioDt.class, order=7, min=0, max=1) - @Description( - shortDefinition="Maximum dose that was consumed per unit of time", - formalDefinition="The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours." - ) - private RatioDt myMaxDosePerPeriod; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myTiming, myAsNeeded, mySite, myRoute, myMethod, myQuantity, myRate, myMaxDosePerPeriod); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myTiming, myAsNeeded, mySite, myRoute, myMethod, myQuantity, myRate, myMaxDosePerPeriod); - } - - /** - * Gets the value(s) for timing (When/how often was medication taken?). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\" - *

- */ - public ScheduleDt getTiming() { - if (myTiming == null) { - myTiming = new ScheduleDt(); - } - return myTiming; - } - - /** - * Sets the value(s) for timing (When/how often was medication taken?) - * - *

- * Definition: - * The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\" - *

- */ - public Dosage setTiming(ScheduleDt theValue) { - myTiming = theValue; - return this; - } - - - /** - * Gets the value(s) for asNeeded[x] (Take \"as needed\" f(or x)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication - *

- */ - public IDatatype getAsNeeded() { - return myAsNeeded; - } - - /** - * Sets the value(s) for asNeeded[x] (Take \"as needed\" f(or x)) - * - *

- * Definition: - * If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication - *

- */ - public Dosage setAsNeeded(IDatatype theValue) { - myAsNeeded = theValue; - return this; - } - - - /** - * Gets the value(s) for site (Where on body was medication administered?). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A coded specification of the anatomic site where the medication first enters the body - *

- */ - public CodeableConceptDt getSite() { - if (mySite == null) { - mySite = new CodeableConceptDt(); - } - return mySite; - } - - /** - * Sets the value(s) for site (Where on body was medication administered?) - * - *

- * Definition: - * A coded specification of the anatomic site where the medication first enters the body - *

- */ - public Dosage setSite(CodeableConceptDt theValue) { - mySite = theValue; - return this; - } - - - /** - * Gets the value(s) for route (How did the medication enter the body?). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject. - *

- */ - public CodeableConceptDt getRoute() { - if (myRoute == null) { - myRoute = new CodeableConceptDt(); - } - return myRoute; - } - - /** - * Sets the value(s) for route (How did the medication enter the body?) - * - *

- * Definition: - * A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject. - *

- */ - public Dosage setRoute(CodeableConceptDt theValue) { - myRoute = theValue; - return this; - } - - - /** - * Gets the value(s) for method (Technique used to administer medication). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.Terminologies used often pre-coordinate this term with the route and or form of administration. - *

- */ - public CodeableConceptDt getMethod() { - if (myMethod == null) { - myMethod = new CodeableConceptDt(); - } - return myMethod; - } - - /** - * Sets the value(s) for method (Technique used to administer medication) - * - *

- * Definition: - * A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV.Terminologies used often pre-coordinate this term with the route and or form of administration. - *

- */ - public Dosage setMethod(CodeableConceptDt theValue) { - myMethod = theValue; - return this; - } - - - /** - * Gets the value(s) for quantity (Amount administered in one dose). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The amount of therapeutic or other substance given at one administration event. - *

- */ - public QuantityDt getQuantity() { - if (myQuantity == null) { - myQuantity = new QuantityDt(); - } - return myQuantity; - } - - /** - * Sets the value(s) for quantity (Amount administered in one dose) - * - *

- * Definition: - * The amount of therapeutic or other substance given at one administration event. - *

- */ - public Dosage setQuantity(QuantityDt theValue) { - myQuantity = theValue; - return this; - } - - /** - * Sets the value for quantity (Amount administered in one dose) - * - *

- * Definition: - * The amount of therapeutic or other substance given at one administration event. - *

- */ - public Dosage setQuantity( QuantityCompararatorEnum theComparator, double theValue, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for quantity (Amount administered in one dose) - * - *

- * Definition: - * The amount of therapeutic or other substance given at one administration event. - *

- */ - public Dosage setQuantity( QuantityCompararatorEnum theComparator, long theValue, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for quantity (Amount administered in one dose) - * - *

- * Definition: - * The amount of therapeutic or other substance given at one administration event. - *

- */ - public Dosage setQuantity( QuantityCompararatorEnum theComparator, double theValue, String theSystem, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for quantity (Amount administered in one dose) - * - *

- * Definition: - * The amount of therapeutic or other substance given at one administration event. - *

- */ - public Dosage setQuantity( QuantityCompararatorEnum theComparator, long theValue, String theSystem, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for quantity (Amount administered in one dose) - * - *

- * Definition: - * The amount of therapeutic or other substance given at one administration event. - *

- */ - public Dosage setQuantity( double theValue) { - myQuantity = new QuantityDt(theValue); - return this; - } - - /** - * Sets the value for quantity (Amount administered in one dose) - * - *

- * Definition: - * The amount of therapeutic or other substance given at one administration event. - *

- */ - public Dosage setQuantity( long theValue) { - myQuantity = new QuantityDt(theValue); - return this; - } - - - /** - * Gets the value(s) for rate (Dose quantity per unit of time). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours. - *

- */ - public RatioDt getRate() { - if (myRate == null) { - myRate = new RatioDt(); - } - return myRate; - } - - /** - * Sets the value(s) for rate (Dose quantity per unit of time) - * - *

- * Definition: - * Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours. - *

- */ - public Dosage setRate(RatioDt theValue) { - myRate = theValue; - return this; - } - - - /** - * Gets the value(s) for maxDosePerPeriod (Maximum dose that was consumed per unit of time). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours. - *

- */ - public RatioDt getMaxDosePerPeriod() { - if (myMaxDosePerPeriod == null) { - myMaxDosePerPeriod = new RatioDt(); - } - return myMaxDosePerPeriod; - } - - /** - * Sets the value(s) for maxDosePerPeriod (Maximum dose that was consumed per unit of time) - * - *

- * Definition: - * The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours. - *

- */ - public Dosage setMaxDosePerPeriod(RatioDt theValue) { - myMaxDosePerPeriod = theValue; - return this; - } - - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MessageHeader.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MessageHeader.java deleted file mode 100644 index f8c68214c12..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MessageHeader.java +++ /dev/null @@ -1,1274 +0,0 @@ - - - - - - - - - - - - - - - - -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.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.ContactUseEnum; -import ca.uhn.fhir.model.dstu.valueset.ResponseTypeEnum; -import ca.uhn.fhir.model.primitive.BoundCodeDt; -import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.IdDt; -import ca.uhn.fhir.model.primitive.InstantDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.primitive.UriDt; - - -/** - * HAPI/FHIR MessageHeader Resource - * (A resource that describes a message that is exchanged between systems) - * - *

- * Definition: - * The header for a message exchange that is either requesting or responding to an action. The resource(s) that are the subject of the action as well as other Information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle - *

- * - *

- * Requirements: - * Many implementations are not prepared to use REST and need a messaging based infrastructure - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/MessageHeader - *

- * - */ -@ResourceDef(name="MessageHeader", profile="http://hl7.org/fhir/profiles/MessageHeader", id="messageheader") -public class MessageHeader extends BaseResource implements IResource { - - - @Child(name="identifier", type=IdDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Id of this message", - formalDefinition="The identifier of this message" - ) - private IdDt myIdentifier; - - @Child(name="timestamp", type=InstantDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="Time that the message was sent", - formalDefinition="The time that the message was sent" - ) - private InstantDt myTimestamp; - - @Child(name="event", type=CodingDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="Code for the event this message represents", - formalDefinition="Code that identifies the event this message represents and connects it with it's definition. Events defined as part of the FHIR specification have the system value \"http://hl7.org/fhir/message-type\"" - ) - private CodingDt myEvent; - - @Child(name="response", order=3, min=0, max=1) - @Description( - shortDefinition="If this is a reply to prior message", - formalDefinition="Information about the message that this message is a response to. Only present if this message is a response." - ) - private Response myResponse; - - @Child(name="source", order=4, min=1, max=1) - @Description( - shortDefinition="Message Source Application", - formalDefinition="The source application from which this message originated" - ) - private Source mySource; - - @Child(name="destination", order=5, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Message Destination Application(s)", - formalDefinition="The destination application which the message is intended for" - ) - private java.util.List myDestination; - - @Child(name="enterer", order=6, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class }) - @Description( - shortDefinition="The source of the data entry", - formalDefinition="The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions" - ) - private ResourceReferenceDt myEnterer; - - @Child(name="author", order=7, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class }) - @Description( - shortDefinition="The source of the decision", - formalDefinition="The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions" - ) - private ResourceReferenceDt myAuthor; - - @Child(name="receiver", order=8, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Organization.class }) - @Description( - shortDefinition="Intended \"real-world\" recipient for the data", - formalDefinition="Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient." - ) - private ResourceReferenceDt myReceiver; - - @Child(name="responsible", order=9, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Organization.class }) - @Description( - shortDefinition="Final responsibility for event", - formalDefinition="The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party" - ) - private ResourceReferenceDt myResponsible; - - @Child(name="reason", type=CodeableConceptDt.class, order=10, min=0, max=1) - @Description( - shortDefinition="Cause of event", - formalDefinition="Coded indication of the cause for the event - indicates a reason for the occurance of the event that is a focus of this message" - ) - private CodeableConceptDt myReason; - - @Child(name="data", order=11, min=0, max=Child.MAX_UNLIMITED, type={ - IResource.class }) - @Description( - shortDefinition="The actual content of the message", - formalDefinition="The actual data of the message - a reference to the root/focus class of the event." - ) - private java.util.List myData; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myTimestamp, myEvent, myResponse, mySource, myDestination, myEnterer, myAuthor, myReceiver, myResponsible, myReason, myData); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myTimestamp, myEvent, myResponse, mySource, myDestination, myEnterer, myAuthor, myReceiver, myResponsible, myReason, myData); - } - - /** - * Gets the value(s) for identifier (Id of this message). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The identifier of this message - *

- */ - public IdDt getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new IdDt(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Id of this message) - * - *

- * Definition: - * The identifier of this message - *

- */ - public MessageHeader setIdentifier(IdDt theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Sets the value for identifier (Id of this message) - * - *

- * Definition: - * The identifier of this message - *

- */ - public MessageHeader setIdentifier( String theId) { - myIdentifier = new IdDt(theId); - return this; - } - - - /** - * Gets the value(s) for timestamp (Time that the message was sent). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The time that the message was sent - *

- */ - public InstantDt getTimestamp() { - if (myTimestamp == null) { - myTimestamp = new InstantDt(); - } - return myTimestamp; - } - - /** - * Sets the value(s) for timestamp (Time that the message was sent) - * - *

- * Definition: - * The time that the message was sent - *

- */ - public MessageHeader setTimestamp(InstantDt theValue) { - myTimestamp = theValue; - return this; - } - - /** - * Sets the value for timestamp (Time that the message was sent) - * - *

- * Definition: - * The time that the message was sent - *

- */ - public MessageHeader setTimestamp( Date theDate, TemporalPrecisionEnum thePrecision) { - myTimestamp = new InstantDt(theDate, thePrecision); - return this; - } - - /** - * Sets the value for timestamp (Time that the message was sent) - * - *

- * Definition: - * The time that the message was sent - *

- */ - public MessageHeader setTimestampWithMillisPrecision( Date theDate) { - myTimestamp = new InstantDt(theDate); - return this; - } - - - /** - * Gets the value(s) for event (Code for the event this message represents). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Code that identifies the event this message represents and connects it with it's definition. Events defined as part of the FHIR specification have the system value \"http://hl7.org/fhir/message-type\" - *

- */ - public CodingDt getEvent() { - if (myEvent == null) { - myEvent = new CodingDt(); - } - return myEvent; - } - - /** - * Sets the value(s) for event (Code for the event this message represents) - * - *

- * Definition: - * Code that identifies the event this message represents and connects it with it's definition. Events defined as part of the FHIR specification have the system value \"http://hl7.org/fhir/message-type\" - *

- */ - public MessageHeader setEvent(CodingDt theValue) { - myEvent = theValue; - return this; - } - - - /** - * Gets the value(s) for response (If this is a reply to prior message). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Information about the message that this message is a response to. Only present if this message is a response. - *

- */ - public Response getResponse() { - if (myResponse == null) { - myResponse = new Response(); - } - return myResponse; - } - - /** - * Sets the value(s) for response (If this is a reply to prior message) - * - *

- * Definition: - * Information about the message that this message is a response to. Only present if this message is a response. - *

- */ - public MessageHeader setResponse(Response theValue) { - myResponse = theValue; - return this; - } - - - /** - * Gets the value(s) for source (Message Source Application). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The source application from which this message originated - *

- */ - public Source getSource() { - if (mySource == null) { - mySource = new Source(); - } - return mySource; - } - - /** - * Sets the value(s) for source (Message Source Application) - * - *

- * Definition: - * The source application from which this message originated - *

- */ - public MessageHeader setSource(Source theValue) { - mySource = theValue; - return this; - } - - - /** - * Gets the value(s) for destination (Message Destination Application(s)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The destination application which the message is intended for - *

- */ - public java.util.List getDestination() { - if (myDestination == null) { - myDestination = new java.util.ArrayList(); - } - return myDestination; - } - - /** - * Sets the value(s) for destination (Message Destination Application(s)) - * - *

- * Definition: - * The destination application which the message is intended for - *

- */ - public MessageHeader setDestination(java.util.List theValue) { - myDestination = theValue; - return this; - } - - /** - * Adds and returns a new value for destination (Message Destination Application(s)) - * - *

- * Definition: - * The destination application which the message is intended for - *

- */ - public Destination addDestination() { - Destination newType = new Destination(); - getDestination().add(newType); - return newType; - } - - /** - * Gets the first repetition for destination (Message Destination Application(s)), - * creating it if it does not already exist. - * - *

- * Definition: - * The destination application which the message is intended for - *

- */ - public Destination getDestinationFirstRep() { - if (getDestination().isEmpty()) { - return addDestination(); - } - return getDestination().get(0); - } - - /** - * Gets the value(s) for enterer (The source of the data entry). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions - *

- */ - public ResourceReferenceDt getEnterer() { - if (myEnterer == null) { - myEnterer = new ResourceReferenceDt(); - } - return myEnterer; - } - - /** - * Sets the value(s) for enterer (The source of the data entry) - * - *

- * Definition: - * The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions - *

- */ - public MessageHeader setEnterer(ResourceReferenceDt theValue) { - myEnterer = theValue; - return this; - } - - - /** - * Gets the value(s) for author (The source of the decision). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions - *

- */ - public ResourceReferenceDt getAuthor() { - if (myAuthor == null) { - myAuthor = new ResourceReferenceDt(); - } - return myAuthor; - } - - /** - * Sets the value(s) for author (The source of the decision) - * - *

- * Definition: - * The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions - *

- */ - public MessageHeader setAuthor(ResourceReferenceDt theValue) { - myAuthor = theValue; - return this; - } - - - /** - * Gets the value(s) for receiver (Intended \"real-world\" recipient for the data). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient. - *

- */ - public ResourceReferenceDt getReceiver() { - if (myReceiver == null) { - myReceiver = new ResourceReferenceDt(); - } - return myReceiver; - } - - /** - * Sets the value(s) for receiver (Intended \"real-world\" recipient for the data) - * - *

- * Definition: - * Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient. - *

- */ - public MessageHeader setReceiver(ResourceReferenceDt theValue) { - myReceiver = theValue; - return this; - } - - - /** - * Gets the value(s) for responsible (Final responsibility for event). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party - *

- */ - public ResourceReferenceDt getResponsible() { - if (myResponsible == null) { - myResponsible = new ResourceReferenceDt(); - } - return myResponsible; - } - - /** - * Sets the value(s) for responsible (Final responsibility for event) - * - *

- * Definition: - * The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party - *

- */ - public MessageHeader setResponsible(ResourceReferenceDt theValue) { - myResponsible = theValue; - return this; - } - - - /** - * Gets the value(s) for reason (Cause of event). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Coded indication of the cause for the event - indicates a reason for the occurance of the event that is a focus of this message - *

- */ - public CodeableConceptDt getReason() { - if (myReason == null) { - myReason = new CodeableConceptDt(); - } - return myReason; - } - - /** - * Sets the value(s) for reason (Cause of event) - * - *

- * Definition: - * Coded indication of the cause for the event - indicates a reason for the occurance of the event that is a focus of this message - *

- */ - public MessageHeader setReason(CodeableConceptDt theValue) { - myReason = theValue; - return this; - } - - - /** - * Gets the value(s) for data (The actual content of the message). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The actual data of the message - a reference to the root/focus class of the event. - *

- */ - public java.util.List getData() { - if (myData == null) { - myData = new java.util.ArrayList(); - } - return myData; - } - - /** - * Sets the value(s) for data (The actual content of the message) - * - *

- * Definition: - * The actual data of the message - a reference to the root/focus class of the event. - *

- */ - public MessageHeader setData(java.util.List theValue) { - myData = theValue; - return this; - } - - /** - * Adds and returns a new value for data (The actual content of the message) - * - *

- * Definition: - * The actual data of the message - a reference to the root/focus class of the event. - *

- */ - public ResourceReferenceDt addData() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getData().add(newType); - return newType; - } - - /** - * Block class for child element: MessageHeader.response (If this is a reply to prior message) - * - *

- * Definition: - * Information about the message that this message is a response to. Only present if this message is a response. - *

- */ - @Block() - public static class Response extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="identifier", type=IdDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Id of original message", - formalDefinition="The id of the message that this message is a response to" - ) - private IdDt myIdentifier; - - @Child(name="code", type=CodeDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="ok | transient-error | fatal-error", - formalDefinition="Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not" - ) - private BoundCodeDt myCode; - - @Child(name="details", order=2, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.OperationOutcome.class }) - @Description( - shortDefinition="Specific list of hints/warnings/errors", - formalDefinition="Full details of any issues found in the message" - ) - private ResourceReferenceDt myDetails; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myCode, myDetails); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myCode, myDetails); - } - - /** - * Gets the value(s) for identifier (Id of original message). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The id of the message that this message is a response to - *

- */ - public IdDt getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new IdDt(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Id of original message) - * - *

- * Definition: - * The id of the message that this message is a response to - *

- */ - public Response setIdentifier(IdDt theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Sets the value for identifier (Id of original message) - * - *

- * Definition: - * The id of the message that this message is a response to - *

- */ - public Response setIdentifier( String theId) { - myIdentifier = new IdDt(theId); - return this; - } - - - /** - * Gets the value(s) for code (ok | transient-error | fatal-error). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not - *

- */ - public BoundCodeDt getCode() { - if (myCode == null) { - myCode = new BoundCodeDt(ResponseTypeEnum.VALUESET_BINDER); - } - return myCode; - } - - /** - * Sets the value(s) for code (ok | transient-error | fatal-error) - * - *

- * Definition: - * Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not - *

- */ - public Response setCode(BoundCodeDt theValue) { - myCode = theValue; - return this; - } - - /** - * Sets the value(s) for code (ok | transient-error | fatal-error) - * - *

- * Definition: - * Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not - *

- */ - public Response setCode(ResponseTypeEnum theValue) { - getCode().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for details (Specific list of hints/warnings/errors). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Full details of any issues found in the message - *

- */ - public ResourceReferenceDt getDetails() { - if (myDetails == null) { - myDetails = new ResourceReferenceDt(); - } - return myDetails; - } - - /** - * Sets the value(s) for details (Specific list of hints/warnings/errors) - * - *

- * Definition: - * Full details of any issues found in the message - *

- */ - public Response setDetails(ResourceReferenceDt theValue) { - myDetails = theValue; - return this; - } - - - - } - - - /** - * Block class for child element: MessageHeader.source (Message Source Application) - * - *

- * Definition: - * The source application from which this message originated - *

- */ - @Block() - public static class Source extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="name", type=StringDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Name of system", - formalDefinition="Human-readable name for the target system" - ) - private StringDt myName; - - @Child(name="software", type=StringDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="Name of software running the system", - formalDefinition="May include configuration or other information useful in debugging." - ) - private StringDt mySoftware; - - @Child(name="version", type=StringDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Version of software running", - formalDefinition="Can convey versions of multiple systems in situations where a message passes through multiple hands." - ) - private StringDt myVersion; - - @Child(name="contact", type=ContactDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Human contact for problems", - formalDefinition="An e-mail, phone, website or other contact point to use to resolve issues with message communications." - ) - private ContactDt myContact; - - @Child(name="endpoint", type=UriDt.class, order=4, min=1, max=1) - @Description( - shortDefinition="Actual message source address or id", - formalDefinition="Identifies the routing target to send acknowledgements to." - ) - private UriDt myEndpoint; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myName, mySoftware, myVersion, myContact, myEndpoint); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myName, mySoftware, myVersion, myContact, myEndpoint); - } - - /** - * Gets the value(s) for name (Name of system). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Human-readable name for the target system - *

- */ - public StringDt getName() { - if (myName == null) { - myName = new StringDt(); - } - return myName; - } - - /** - * Sets the value(s) for name (Name of system) - * - *

- * Definition: - * Human-readable name for the target system - *

- */ - public Source setName(StringDt theValue) { - myName = theValue; - return this; - } - - /** - * Sets the value for name (Name of system) - * - *

- * Definition: - * Human-readable name for the target system - *

- */ - public Source setName( String theString) { - myName = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for software (Name of software running the system). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * May include configuration or other information useful in debugging. - *

- */ - public StringDt getSoftware() { - if (mySoftware == null) { - mySoftware = new StringDt(); - } - return mySoftware; - } - - /** - * Sets the value(s) for software (Name of software running the system) - * - *

- * Definition: - * May include configuration or other information useful in debugging. - *

- */ - public Source setSoftware(StringDt theValue) { - mySoftware = theValue; - return this; - } - - /** - * Sets the value for software (Name of software running the system) - * - *

- * Definition: - * May include configuration or other information useful in debugging. - *

- */ - public Source setSoftware( String theString) { - mySoftware = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for version (Version of software running). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Can convey versions of multiple systems in situations where a message passes through multiple hands. - *

- */ - public StringDt getVersion() { - if (myVersion == null) { - myVersion = new StringDt(); - } - return myVersion; - } - - /** - * Sets the value(s) for version (Version of software running) - * - *

- * Definition: - * Can convey versions of multiple systems in situations where a message passes through multiple hands. - *

- */ - public Source setVersion(StringDt theValue) { - myVersion = theValue; - return this; - } - - /** - * Sets the value for version (Version of software running) - * - *

- * Definition: - * Can convey versions of multiple systems in situations where a message passes through multiple hands. - *

- */ - public Source setVersion( String theString) { - myVersion = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for contact (Human contact for problems). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * An e-mail, phone, website or other contact point to use to resolve issues with message communications. - *

- */ - public ContactDt getContact() { - if (myContact == null) { - myContact = new ContactDt(); - } - return myContact; - } - - /** - * Sets the value(s) for contact (Human contact for problems) - * - *

- * Definition: - * An e-mail, phone, website or other contact point to use to resolve issues with message communications. - *

- */ - public Source setContact(ContactDt theValue) { - myContact = theValue; - return this; - } - - /** - * Sets the value for contact (Human contact for problems) - * - *

- * Definition: - * An e-mail, phone, website or other contact point to use to resolve issues with message communications. - *

- */ - public Source setContact( ContactUseEnum theContactUse, String theValue) { - myContact = new ContactDt(theContactUse, theValue); - return this; - } - - /** - * Sets the value for contact (Human contact for problems) - * - *

- * Definition: - * An e-mail, phone, website or other contact point to use to resolve issues with message communications. - *

- */ - public Source setContact( String theValue) { - myContact = new ContactDt(theValue); - return this; - } - - - /** - * Gets the value(s) for endpoint (Actual message source address or id). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the routing target to send acknowledgements to. - *

- */ - public UriDt getEndpoint() { - if (myEndpoint == null) { - myEndpoint = new UriDt(); - } - return myEndpoint; - } - - /** - * Sets the value(s) for endpoint (Actual message source address or id) - * - *

- * Definition: - * Identifies the routing target to send acknowledgements to. - *

- */ - public Source setEndpoint(UriDt theValue) { - myEndpoint = theValue; - return this; - } - - /** - * Sets the value for endpoint (Actual message source address or id) - * - *

- * Definition: - * Identifies the routing target to send acknowledgements to. - *

- */ - public Source setEndpoint( String theUri) { - myEndpoint = new UriDt(theUri); - return this; - } - - - - } - - - /** - * Block class for child element: MessageHeader.destination (Message Destination Application(s)) - * - *

- * Definition: - * The destination application which the message is intended for - *

- */ - @Block() - public static class Destination extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="name", type=StringDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Name of system", - formalDefinition="Human-readable name for the source system" - ) - private StringDt myName; - - @Child(name="target", order=1, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Device.class }) - @Description( - shortDefinition="Particular delivery destination within the destination", - formalDefinition="Identifies the target end system in situations where the initial message transmission is to an intermediary system." - ) - private ResourceReferenceDt myTarget; - - @Child(name="endpoint", type=UriDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="Actual destination address or id", - formalDefinition="Indicates where the message should be routed to." - ) - private UriDt myEndpoint; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myName, myTarget, myEndpoint); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myName, myTarget, myEndpoint); - } - - /** - * Gets the value(s) for name (Name of system). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Human-readable name for the source system - *

- */ - public StringDt getName() { - if (myName == null) { - myName = new StringDt(); - } - return myName; - } - - /** - * Sets the value(s) for name (Name of system) - * - *

- * Definition: - * Human-readable name for the source system - *

- */ - public Destination setName(StringDt theValue) { - myName = theValue; - return this; - } - - /** - * Sets the value for name (Name of system) - * - *

- * Definition: - * Human-readable name for the source system - *

- */ - public Destination setName( String theString) { - myName = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for target (Particular delivery destination within the destination). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the target end system in situations where the initial message transmission is to an intermediary system. - *

- */ - public ResourceReferenceDt getTarget() { - if (myTarget == null) { - myTarget = new ResourceReferenceDt(); - } - return myTarget; - } - - /** - * Sets the value(s) for target (Particular delivery destination within the destination) - * - *

- * Definition: - * Identifies the target end system in situations where the initial message transmission is to an intermediary system. - *

- */ - public Destination setTarget(ResourceReferenceDt theValue) { - myTarget = theValue; - return this; - } - - - /** - * Gets the value(s) for endpoint (Actual destination address or id). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates where the message should be routed to. - *

- */ - public UriDt getEndpoint() { - if (myEndpoint == null) { - myEndpoint = new UriDt(); - } - return myEndpoint; - } - - /** - * Sets the value(s) for endpoint (Actual destination address or id) - * - *

- * Definition: - * Indicates where the message should be routed to. - *

- */ - public Destination setEndpoint(UriDt theValue) { - myEndpoint = theValue; - return this; - } - - /** - * Sets the value for endpoint (Actual destination address or id) - * - *

- * Definition: - * Indicates where the message should be routed to. - *

- */ - public Destination setEndpoint( String theUri) { - myEndpoint = new UriDt(theUri); - return this; - } - - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Microarray.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Microarray.java deleted file mode 100644 index 1d99def65fc..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Microarray.java +++ /dev/null @@ -1,1492 +0,0 @@ - - - - - - - - - - - - - - - - -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.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.primitive.BooleanDt; -import ca.uhn.fhir.model.primitive.DateDt; -import ca.uhn.fhir.model.primitive.DecimalDt; -import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.StringClientParam; - - -/** - * HAPI/FHIR Microarray Resource - * (Microarray) - * - *

- * Definition: - * A resource that displays result of a microarray - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Microarray - *

- * - */ -@ResourceDef(name="Microarray", profile="http://hl7.org/fhir/profiles/Microarray", id="microarray") -public class Microarray extends BaseResource implements IResource { - - /** - * Search parameter constant for patient - *

- * Description: Patient described by the microarray
- * Type: reference
- * Path: Microarray.subject.patient
- *

- */ - @SearchParamDefinition(name="patient", path="Microarray.subject.patient", description="Patient described by the microarray", type="reference" ) - public static final String SP_PATIENT = "patient"; - - /** - * Fluent Client search parameter constant for patient - *

- * Description: Patient described by the microarray
- * Type: reference
- * Path: Microarray.subject.patient
- *

- */ - public static final ReferenceClientParam PATIENT = new ReferenceClientParam(SP_PATIENT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Microarray.subject.patient". - */ - public static final Include INCLUDE_SUBJECT_PATIENT = new Include("Microarray.subject.patient"); - - /** - * Search parameter constant for gene - *

- * Description: Gene studied in the microarray
- * Type: string
- * Path: Microarray.sample.gene.identity
- *

- */ - @SearchParamDefinition(name="gene", path="Microarray.sample.gene.identity", description="Gene studied in the microarray", type="string" ) - public static final String SP_GENE = "gene"; - - /** - * Fluent Client search parameter constant for gene - *

- * Description: Gene studied in the microarray
- * Type: string
- * Path: Microarray.sample.gene.identity
- *

- */ - public static final StringClientParam GENE = new StringClientParam(SP_GENE); - - /** - * Search parameter constant for coordinate - *

- * Description: Coordinate of the gene
- * Type: string
- * Path: Microarray.sample.gene.coordinate
- *

- */ - @SearchParamDefinition(name="coordinate", path="Microarray.sample.gene.coordinate", description="Coordinate of the gene", type="string" ) - public static final String SP_COORDINATE = "coordinate"; - - /** - * Fluent Client search parameter constant for coordinate - *

- * Description: Coordinate of the gene
- * Type: string
- * Path: Microarray.sample.gene.coordinate
- *

- */ - public static final StringClientParam COORDINATE = new StringClientParam(SP_COORDINATE); - - - @Child(name="subject", order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Subject of the microarray", - formalDefinition="Subject of the microarray" - ) - private java.util.List mySubject; - - @Child(name="organization", order=1, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Organization.class }) - @Description( - shortDefinition="Organization", - formalDefinition="Organization that does the microarray" - ) - private ResourceReferenceDt myOrganization; - - @Child(name="date", type=DateDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="Date", - formalDefinition="Date when result of the microarray is updated" - ) - private DateDt myDate; - - @Child(name="scanner", order=3, min=1, max=1) - @Description( - shortDefinition="Scanner", - formalDefinition="Scanner used in the microarray" - ) - private Scanner myScanner; - - @Child(name="sample", order=4, min=1, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Sample", - formalDefinition="Sample of a grid on the chip" - ) - private java.util.List mySample; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySubject, myOrganization, myDate, myScanner, mySample); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySubject, myOrganization, myDate, myScanner, mySample); - } - - /** - * Gets the value(s) for subject (Subject of the microarray). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Subject of the microarray - *

- */ - public java.util.List getSubject() { - if (mySubject == null) { - mySubject = new java.util.ArrayList(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (Subject of the microarray) - * - *

- * Definition: - * Subject of the microarray - *

- */ - public Microarray setSubject(java.util.List theValue) { - mySubject = theValue; - return this; - } - - /** - * Adds and returns a new value for subject (Subject of the microarray) - * - *

- * Definition: - * Subject of the microarray - *

- */ - public Subject addSubject() { - Subject newType = new Subject(); - getSubject().add(newType); - return newType; - } - - /** - * Gets the first repetition for subject (Subject of the microarray), - * creating it if it does not already exist. - * - *

- * Definition: - * Subject of the microarray - *

- */ - public Subject getSubjectFirstRep() { - if (getSubject().isEmpty()) { - return addSubject(); - } - return getSubject().get(0); - } - - /** - * Gets the value(s) for organization (Organization). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Organization that does the microarray - *

- */ - public ResourceReferenceDt getOrganization() { - if (myOrganization == null) { - myOrganization = new ResourceReferenceDt(); - } - return myOrganization; - } - - /** - * Sets the value(s) for organization (Organization) - * - *

- * Definition: - * Organization that does the microarray - *

- */ - public Microarray setOrganization(ResourceReferenceDt theValue) { - myOrganization = theValue; - return this; - } - - - /** - * Gets the value(s) for date (Date). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Date when result of the microarray is updated - *

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

- * Definition: - * Date when result of the microarray is updated - *

- */ - public Microarray setDate(DateDt theValue) { - myDate = theValue; - return this; - } - - /** - * Sets the value for date (Date) - * - *

- * Definition: - * Date when result of the microarray is updated - *

- */ - public Microarray setDateWithDayPrecision( Date theDate) { - myDate = new DateDt(theDate); - return this; - } - - /** - * Sets the value for date (Date) - * - *

- * Definition: - * Date when result of the microarray is updated - *

- */ - public Microarray setDate( Date theDate, TemporalPrecisionEnum thePrecision) { - myDate = new DateDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for scanner (Scanner). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Scanner used in the microarray - *

- */ - public Scanner getScanner() { - if (myScanner == null) { - myScanner = new Scanner(); - } - return myScanner; - } - - /** - * Sets the value(s) for scanner (Scanner) - * - *

- * Definition: - * Scanner used in the microarray - *

- */ - public Microarray setScanner(Scanner theValue) { - myScanner = theValue; - return this; - } - - - /** - * Gets the value(s) for sample (Sample). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Sample of a grid on the chip - *

- */ - public java.util.List getSample() { - if (mySample == null) { - mySample = new java.util.ArrayList(); - } - return mySample; - } - - /** - * Sets the value(s) for sample (Sample) - * - *

- * Definition: - * Sample of a grid on the chip - *

- */ - public Microarray setSample(java.util.List theValue) { - mySample = theValue; - return this; - } - - /** - * Adds and returns a new value for sample (Sample) - * - *

- * Definition: - * Sample of a grid on the chip - *

- */ - public Sample addSample() { - Sample newType = new Sample(); - getSample().add(newType); - return newType; - } - - /** - * Gets the first repetition for sample (Sample), - * creating it if it does not already exist. - * - *

- * Definition: - * Sample of a grid on the chip - *

- */ - public Sample getSampleFirstRep() { - if (getSample().isEmpty()) { - return addSample(); - } - return getSample().get(0); - } - - /** - * Block class for child element: Microarray.subject (Subject of the microarray) - * - *

- * Definition: - * Subject of the microarray - *

- */ - @Block() - public static class Subject extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="patient", order=0, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="Resource that corresponds to the subject", - formalDefinition="Resource that corresponds to the subject" - ) - private ResourceReferenceDt myPatient; - - @Child(name="sampleId", type=StringDt.class, order=1, min=1, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Id of the sample that belongs to the subject", - formalDefinition="Id of the sample that belongs to the subject" - ) - private java.util.List mySampleId; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myPatient, mySampleId); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myPatient, mySampleId); - } - - /** - * Gets the value(s) for patient (Resource that corresponds to the subject). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Resource that corresponds to the subject - *

- */ - public ResourceReferenceDt getPatient() { - if (myPatient == null) { - myPatient = new ResourceReferenceDt(); - } - return myPatient; - } - - /** - * Sets the value(s) for patient (Resource that corresponds to the subject) - * - *

- * Definition: - * Resource that corresponds to the subject - *

- */ - public Subject setPatient(ResourceReferenceDt theValue) { - myPatient = theValue; - return this; - } - - - /** - * Gets the value(s) for sampleId (Id of the sample that belongs to the subject). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Id of the sample that belongs to the subject - *

- */ - public java.util.List getSampleId() { - if (mySampleId == null) { - mySampleId = new java.util.ArrayList(); - } - return mySampleId; - } - - /** - * Sets the value(s) for sampleId (Id of the sample that belongs to the subject) - * - *

- * Definition: - * Id of the sample that belongs to the subject - *

- */ - public Subject setSampleId(java.util.List theValue) { - mySampleId = theValue; - return this; - } - - /** - * Adds and returns a new value for sampleId (Id of the sample that belongs to the subject) - * - *

- * Definition: - * Id of the sample that belongs to the subject - *

- */ - public StringDt addSampleId() { - StringDt newType = new StringDt(); - getSampleId().add(newType); - return newType; - } - - /** - * Gets the first repetition for sampleId (Id of the sample that belongs to the subject), - * creating it if it does not already exist. - * - *

- * Definition: - * Id of the sample that belongs to the subject - *

- */ - public StringDt getSampleIdFirstRep() { - if (getSampleId().isEmpty()) { - return addSampleId(); - } - return getSampleId().get(0); - } - /** - * Adds a new value for sampleId (Id of the sample that belongs to the subject) - * - *

- * Definition: - * Id of the sample that belongs to the subject - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Subject addSampleId( String theString) { - if (mySampleId == null) { - mySampleId = new java.util.ArrayList(); - } - mySampleId.add(new StringDt(theString)); - return this; - } - - - - } - - - /** - * Block class for child element: Microarray.scanner (Scanner) - * - *

- * Definition: - * Scanner used in the microarray - *

- */ - @Block() - public static class Scanner extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="manufacturer", order=0, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Organization.class }) - @Description( - shortDefinition="Scanner manufacturer", - formalDefinition="Manufactuerer of the scanner" - ) - private ResourceReferenceDt myManufacturer; - - @Child(name="name", type=StringDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Scanner name", - formalDefinition="Name of scanner model" - ) - private StringDt myName; - - @Child(name="version", type=StringDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Scanner version", - formalDefinition="Version of the model" - ) - private StringDt myVersion; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myManufacturer, myName, myVersion); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myManufacturer, myName, myVersion); - } - - /** - * Gets the value(s) for manufacturer (Scanner manufacturer). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Manufactuerer of the scanner - *

- */ - public ResourceReferenceDt getManufacturer() { - if (myManufacturer == null) { - myManufacturer = new ResourceReferenceDt(); - } - return myManufacturer; - } - - /** - * Sets the value(s) for manufacturer (Scanner manufacturer) - * - *

- * Definition: - * Manufactuerer of the scanner - *

- */ - public Scanner setManufacturer(ResourceReferenceDt theValue) { - myManufacturer = theValue; - return this; - } - - - /** - * Gets the value(s) for name (Scanner name). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Name of scanner model - *

- */ - public StringDt getName() { - if (myName == null) { - myName = new StringDt(); - } - return myName; - } - - /** - * Sets the value(s) for name (Scanner name) - * - *

- * Definition: - * Name of scanner model - *

- */ - public Scanner setName(StringDt theValue) { - myName = theValue; - return this; - } - - /** - * Sets the value for name (Scanner name) - * - *

- * Definition: - * Name of scanner model - *

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

- * Definition: - * Version of the model - *

- */ - public StringDt getVersion() { - if (myVersion == null) { - myVersion = new StringDt(); - } - return myVersion; - } - - /** - * Sets the value(s) for version (Scanner version) - * - *

- * Definition: - * Version of the model - *

- */ - public Scanner setVersion(StringDt theValue) { - myVersion = theValue; - return this; - } - - /** - * Sets the value for version (Scanner version) - * - *

- * Definition: - * Version of the model - *

- */ - public Scanner setVersion( String theString) { - myVersion = new StringDt(theString); - return this; - } - - - - } - - - /** - * Block class for child element: Microarray.sample (Sample) - * - *

- * Definition: - * Sample of a grid on the chip - *

- */ - @Block() - public static class Sample extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="identity", type=StringDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Id of the sample", - formalDefinition="Id of the sample" - ) - private StringDt myIdentity; - - @Child(name="organism", type=CodeableConceptDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="Sample", - formalDefinition="Organism that the sample belong s to" - ) - private CodeableConceptDt myOrganism; - - @Child(name="specimen", order=2, min=0, max=1) - @Description( - shortDefinition="Organism", - formalDefinition="Specimen used on the grid" - ) - private SampleSpecimen mySpecimen; - - @Child(name="gene", order=3, min=1, max=1) - @Description( - shortDefinition="Gene of study", - formalDefinition="Gene of study" - ) - private SampleGene myGene; - - @Child(name="intensity", type=DecimalDt.class, order=4, min=1, max=1) - @Description( - shortDefinition="Intensity", - formalDefinition="Intensity(expression) of the gene" - ) - private DecimalDt myIntensity; - - @Child(name="isControl", type=BooleanDt.class, order=5, min=1, max=1) - @Description( - shortDefinition="Control", - formalDefinition="Whether the grid is a control in the experiment" - ) - private BooleanDt myIsControl; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentity, myOrganism, mySpecimen, myGene, myIntensity, myIsControl); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentity, myOrganism, mySpecimen, myGene, myIntensity, myIsControl); - } - - /** - * Gets the value(s) for identity (Id of the sample). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Id of the sample - *

- */ - public StringDt getIdentity() { - if (myIdentity == null) { - myIdentity = new StringDt(); - } - return myIdentity; - } - - /** - * Sets the value(s) for identity (Id of the sample) - * - *

- * Definition: - * Id of the sample - *

- */ - public Sample setIdentity(StringDt theValue) { - myIdentity = theValue; - return this; - } - - /** - * Sets the value for identity (Id of the sample) - * - *

- * Definition: - * Id of the sample - *

- */ - public Sample setIdentity( String theString) { - myIdentity = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for organism (Sample). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Organism that the sample belong s to - *

- */ - public CodeableConceptDt getOrganism() { - if (myOrganism == null) { - myOrganism = new CodeableConceptDt(); - } - return myOrganism; - } - - /** - * Sets the value(s) for organism (Sample) - * - *

- * Definition: - * Organism that the sample belong s to - *

- */ - public Sample setOrganism(CodeableConceptDt theValue) { - myOrganism = theValue; - return this; - } - - - /** - * Gets the value(s) for specimen (Organism). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Specimen used on the grid - *

- */ - public SampleSpecimen getSpecimen() { - if (mySpecimen == null) { - mySpecimen = new SampleSpecimen(); - } - return mySpecimen; - } - - /** - * Sets the value(s) for specimen (Organism) - * - *

- * Definition: - * Specimen used on the grid - *

- */ - public Sample setSpecimen(SampleSpecimen theValue) { - mySpecimen = theValue; - return this; - } - - - /** - * Gets the value(s) for gene (Gene of study). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Gene of study - *

- */ - public SampleGene getGene() { - if (myGene == null) { - myGene = new SampleGene(); - } - return myGene; - } - - /** - * Sets the value(s) for gene (Gene of study) - * - *

- * Definition: - * Gene of study - *

- */ - public Sample setGene(SampleGene theValue) { - myGene = theValue; - return this; - } - - - /** - * Gets the value(s) for intensity (Intensity). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Intensity(expression) of the gene - *

- */ - public DecimalDt getIntensity() { - if (myIntensity == null) { - myIntensity = new DecimalDt(); - } - return myIntensity; - } - - /** - * Sets the value(s) for intensity (Intensity) - * - *

- * Definition: - * Intensity(expression) of the gene - *

- */ - public Sample setIntensity(DecimalDt theValue) { - myIntensity = theValue; - return this; - } - - /** - * Sets the value for intensity (Intensity) - * - *

- * Definition: - * Intensity(expression) of the gene - *

- */ - public Sample setIntensity( long theValue) { - myIntensity = new DecimalDt(theValue); - return this; - } - - /** - * Sets the value for intensity (Intensity) - * - *

- * Definition: - * Intensity(expression) of the gene - *

- */ - public Sample setIntensity( double theValue) { - myIntensity = new DecimalDt(theValue); - return this; - } - - /** - * Sets the value for intensity (Intensity) - * - *

- * Definition: - * Intensity(expression) of the gene - *

- */ - public Sample setIntensity( java.math.BigDecimal theValue) { - myIntensity = new DecimalDt(theValue); - return this; - } - - - /** - * Gets the value(s) for isControl (Control). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Whether the grid is a control in the experiment - *

- */ - public BooleanDt getIsControl() { - if (myIsControl == null) { - myIsControl = new BooleanDt(); - } - return myIsControl; - } - - /** - * Sets the value(s) for isControl (Control) - * - *

- * Definition: - * Whether the grid is a control in the experiment - *

- */ - public Sample setIsControl(BooleanDt theValue) { - myIsControl = theValue; - return this; - } - - /** - * Sets the value for isControl (Control) - * - *

- * Definition: - * Whether the grid is a control in the experiment - *

- */ - public Sample setIsControl( boolean theBoolean) { - myIsControl = new BooleanDt(theBoolean); - return this; - } - - - - } - - /** - * Block class for child element: Microarray.sample.specimen (Organism) - * - *

- * Definition: - * Specimen used on the grid - *

- */ - @Block() - public static class SampleSpecimen extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="type", type=StringDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Specimen type", - formalDefinition="Type of the specimen" - ) - private StringDt myType; - - @Child(name="source", type=CodeableConceptDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Specimen source", - formalDefinition="Source of the specimen" - ) - private CodeableConceptDt mySource; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myType, mySource); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myType, mySource); - } - - /** - * Gets the value(s) for type (Specimen type). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Type of the specimen - *

- */ - public StringDt getType() { - if (myType == null) { - myType = new StringDt(); - } - return myType; - } - - /** - * Sets the value(s) for type (Specimen type) - * - *

- * Definition: - * Type of the specimen - *

- */ - public SampleSpecimen setType(StringDt theValue) { - myType = theValue; - return this; - } - - /** - * Sets the value for type (Specimen type) - * - *

- * Definition: - * Type of the specimen - *

- */ - public SampleSpecimen setType( String theString) { - myType = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for source (Specimen source). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Source of the specimen - *

- */ - public CodeableConceptDt getSource() { - if (mySource == null) { - mySource = new CodeableConceptDt(); - } - return mySource; - } - - /** - * Sets the value(s) for source (Specimen source) - * - *

- * Definition: - * Source of the specimen - *

- */ - public SampleSpecimen setSource(CodeableConceptDt theValue) { - mySource = theValue; - return this; - } - - - - } - - - /** - * Block class for child element: Microarray.sample.gene (Gene of study) - * - *

- * Definition: - * Gene of study - *

- */ - @Block() - public static class SampleGene extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="identity", type=StringDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Identifier of the gene", - formalDefinition="Identifier of the gene" - ) - private StringDt myIdentity; - - @Child(name="coordinate", order=1, min=0, max=1) - @Description( - shortDefinition="Coordinate of the gene", - formalDefinition="Coordinate of the gene" - ) - private SampleGeneCoordinate myCoordinate; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentity, myCoordinate); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentity, myCoordinate); - } - - /** - * Gets the value(s) for identity (Identifier of the gene). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifier of the gene - *

- */ - public StringDt getIdentity() { - if (myIdentity == null) { - myIdentity = new StringDt(); - } - return myIdentity; - } - - /** - * Sets the value(s) for identity (Identifier of the gene) - * - *

- * Definition: - * Identifier of the gene - *

- */ - public SampleGene setIdentity(StringDt theValue) { - myIdentity = theValue; - return this; - } - - /** - * Sets the value for identity (Identifier of the gene) - * - *

- * Definition: - * Identifier of the gene - *

- */ - public SampleGene setIdentity( String theString) { - myIdentity = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for coordinate (Coordinate of the gene). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Coordinate of the gene - *

- */ - public SampleGeneCoordinate getCoordinate() { - if (myCoordinate == null) { - myCoordinate = new SampleGeneCoordinate(); - } - return myCoordinate; - } - - /** - * Sets the value(s) for coordinate (Coordinate of the gene) - * - *

- * Definition: - * Coordinate of the gene - *

- */ - public SampleGene setCoordinate(SampleGeneCoordinate theValue) { - myCoordinate = theValue; - return this; - } - - - - } - - /** - * Block class for child element: Microarray.sample.gene.coordinate (Coordinate of the gene) - * - *

- * Definition: - * Coordinate of the gene - *

- */ - @Block() - public static class SampleGeneCoordinate extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="chromosome", type=StringDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Chromosome", - formalDefinition="Chromosome" - ) - private StringDt myChromosome; - - @Child(name="start", type=IntegerDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="Start position", - formalDefinition="Start position" - ) - private IntegerDt myStart; - - @Child(name="end", type=IntegerDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="End position", - formalDefinition="End position" - ) - private IntegerDt myEnd; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myChromosome, myStart, myEnd); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myChromosome, myStart, myEnd); - } - - /** - * Gets the value(s) for chromosome (Chromosome). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Chromosome - *

- */ - public StringDt getChromosome() { - if (myChromosome == null) { - myChromosome = new StringDt(); - } - return myChromosome; - } - - /** - * Sets the value(s) for chromosome (Chromosome) - * - *

- * Definition: - * Chromosome - *

- */ - public SampleGeneCoordinate setChromosome(StringDt theValue) { - myChromosome = theValue; - return this; - } - - /** - * Sets the value for chromosome (Chromosome) - * - *

- * Definition: - * Chromosome - *

- */ - public SampleGeneCoordinate setChromosome( String theString) { - myChromosome = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for start (Start position). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Start position - *

- */ - public IntegerDt getStart() { - if (myStart == null) { - myStart = new IntegerDt(); - } - return myStart; - } - - /** - * Sets the value(s) for start (Start position) - * - *

- * Definition: - * Start position - *

- */ - public SampleGeneCoordinate setStart(IntegerDt theValue) { - myStart = theValue; - return this; - } - - /** - * Sets the value for start (Start position) - * - *

- * Definition: - * Start position - *

- */ - public SampleGeneCoordinate setStart( int theInteger) { - myStart = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for end (End position). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * End position - *

- */ - public IntegerDt getEnd() { - if (myEnd == null) { - myEnd = new IntegerDt(); - } - return myEnd; - } - - /** - * Sets the value(s) for end (End position) - * - *

- * Definition: - * End position - *

- */ - public SampleGeneCoordinate setEnd(IntegerDt theValue) { - myEnd = theValue; - return this; - } - - /** - * Sets the value for end (End position) - * - *

- * Definition: - * End position - *

- */ - public SampleGeneCoordinate setEnd( int theInteger) { - myEnd = new IntegerDt(theInteger); - return this; - } - - - - } - - - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Observation.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Observation.java deleted file mode 100644 index 73a9e5b11ee..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Observation.java +++ /dev/null @@ -1,1756 +0,0 @@ - - - - - - - - - - - - - - - - -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.AttachmentDt; -import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.RangeDt; -import ca.uhn.fhir.model.dstu.composite.RatioDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.composite.SampledDataDt; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationInterpretationCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationReliabilityEnum; -import ca.uhn.fhir.model.dstu.valueset.ObservationStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; -import ca.uhn.fhir.model.primitive.BoundCodeDt; -import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; -import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.model.primitive.InstantDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.rest.gclient.CompositeClientParam; -import ca.uhn.fhir.rest.gclient.DateClientParam; -import ca.uhn.fhir.rest.gclient.QuantityClientParam; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.StringClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR Observation Resource - * (Measurements and simple assertions) - * - *

- * Definition: - * Measurements and simple assertions made about a patient, device or other subject - *

- * - *

- * Requirements: - * Observations are a key aspect of healthcare. This resource is used to capture those that do not require more sophisticated mechanisms. - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Observation - *

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

- * Description: The name of the observation type
- * Type: token
- * Path: Observation.name
- *

- */ - @SearchParamDefinition(name="name", path="Observation.name", description="The name of the observation type", type="token" ) - public static final String SP_NAME = "name"; - - /** - * Fluent Client search parameter constant for name - *

- * Description: The name of the observation type
- * Type: token
- * Path: Observation.name
- *

- */ - public static final TokenClientParam NAME = new TokenClientParam(SP_NAME); - - /** - * Search parameter constant for value-quantity - *

- * Description: The value of the observation, if the value is a Quantity, or a SampledData (just search on the bounds of the values in sampled data)
- * Type: quantity
- * Path: Observation.value[x]
- *

- */ - @SearchParamDefinition(name="value-quantity", path="Observation.value[x]", description="The value of the observation, if the value is a Quantity, or a SampledData (just search on the bounds of the values in sampled data)", type="quantity" ) - public static final String SP_VALUE_QUANTITY = "value-quantity"; - - /** - * Fluent Client search parameter constant for value-quantity - *

- * Description: The value of the observation, if the value is a Quantity, or a SampledData (just search on the bounds of the values in sampled data)
- * Type: quantity
- * Path: Observation.value[x]
- *

- */ - public static final QuantityClientParam VALUE_QUANTITY = new QuantityClientParam(SP_VALUE_QUANTITY); - - /** - * Search parameter constant for value-concept - *

- * Description: The value of the observation, if the value is a CodeableConcept
- * Type: token
- * Path: Observation.value[x]
- *

- */ - @SearchParamDefinition(name="value-concept", path="Observation.value[x]", description="The value of the observation, if the value is a CodeableConcept", type="token" ) - public static final String SP_VALUE_CONCEPT = "value-concept"; - - /** - * Fluent Client search parameter constant for value-concept - *

- * Description: The value of the observation, if the value is a CodeableConcept
- * Type: token
- * Path: Observation.value[x]
- *

- */ - public static final TokenClientParam VALUE_CONCEPT = new TokenClientParam(SP_VALUE_CONCEPT); - - /** - * Search parameter constant for value-date - *

- * Description: The value of the observation, if the value is a Period
- * Type: date
- * Path: Observation.value[x]
- *

- */ - @SearchParamDefinition(name="value-date", path="Observation.value[x]", description="The value of the observation, if the value is a Period", type="date" ) - public static final String SP_VALUE_DATE = "value-date"; - - /** - * Fluent Client search parameter constant for value-date - *

- * Description: The value of the observation, if the value is a Period
- * Type: date
- * Path: Observation.value[x]
- *

- */ - public static final DateClientParam VALUE_DATE = new DateClientParam(SP_VALUE_DATE); - - /** - * Search parameter constant for value-string - *

- * Description: The value of the observation, if the value is a string, and also searches in CodeableConcept.text
- * Type: string
- * Path: Observation.value[x]
- *

- */ - @SearchParamDefinition(name="value-string", path="Observation.value[x]", description="The value of the observation, if the value is a string, and also searches in CodeableConcept.text", type="string" ) - public static final String SP_VALUE_STRING = "value-string"; - - /** - * Fluent Client search parameter constant for value-string - *

- * Description: The value of the observation, if the value is a string, and also searches in CodeableConcept.text
- * Type: string
- * Path: Observation.value[x]
- *

- */ - public static final StringClientParam VALUE_STRING = new StringClientParam(SP_VALUE_STRING); - - /** - * Search parameter constant for date - *

- * Description: Obtained date/time. If the obtained element is a period, a date that falls in the period
- * Type: date
- * Path: Observation.applies[x]
- *

- */ - @SearchParamDefinition(name="date", path="Observation.applies[x]", description="Obtained date/time. If the obtained element is a period, a date that falls in the period", type="date" ) - public static final String SP_DATE = "date"; - - /** - * Fluent Client search parameter constant for date - *

- * Description: Obtained date/time. If the obtained element is a period, a date that falls in the period
- * Type: date
- * Path: Observation.applies[x]
- *

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

- * Description: The status of the observation
- * Type: token
- * Path: Observation.status
- *

- */ - @SearchParamDefinition(name="status", path="Observation.status", description="The status of the observation", type="token" ) - public static final String SP_STATUS = "status"; - - /** - * Fluent Client search parameter constant for status - *

- * Description: The status of the observation
- * Type: token
- * Path: Observation.status
- *

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

- * Description: The reliability of the observation
- * Type: token
- * Path: Observation.reliability
- *

- */ - @SearchParamDefinition(name="reliability", path="Observation.reliability", description="The reliability of the observation", type="token" ) - public static final String SP_RELIABILITY = "reliability"; - - /** - * Fluent Client search parameter constant for reliability - *

- * Description: The reliability of the observation
- * Type: token
- * Path: Observation.reliability
- *

- */ - public static final TokenClientParam RELIABILITY = new TokenClientParam(SP_RELIABILITY); - - /** - * Search parameter constant for subject - *

- * Description: The subject that the observation is about
- * Type: reference
- * Path: Observation.subject
- *

- */ - @SearchParamDefinition(name="subject", path="Observation.subject", description="The subject that the observation is about", type="reference" ) - public static final String SP_SUBJECT = "subject"; - - /** - * Fluent Client search parameter constant for subject - *

- * Description: The subject that the observation is about
- * Type: reference
- * Path: Observation.subject
- *

- */ - public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Observation.subject". - */ - public static final Include INCLUDE_SUBJECT = new Include("Observation.subject"); - - /** - * Search parameter constant for performer - *

- * Description: Who and/or what performed the observation
- * Type: reference
- * Path: Observation.performer
- *

- */ - @SearchParamDefinition(name="performer", path="Observation.performer", description="Who and/or what performed the observation", type="reference" ) - public static final String SP_PERFORMER = "performer"; - - /** - * Fluent Client search parameter constant for performer - *

- * Description: Who and/or what performed the observation
- * Type: reference
- * Path: Observation.performer
- *

- */ - public static final ReferenceClientParam PERFORMER = new ReferenceClientParam(SP_PERFORMER); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Observation.performer". - */ - public static final Include INCLUDE_PERFORMER = new Include("Observation.performer"); - - /** - * Search parameter constant for specimen - *

- * Description:
- * Type: reference
- * Path: Observation.specimen
- *

- */ - @SearchParamDefinition(name="specimen", path="Observation.specimen", description="", type="reference" ) - public static final String SP_SPECIMEN = "specimen"; - - /** - * Fluent Client search parameter constant for specimen - *

- * Description:
- * Type: reference
- * Path: Observation.specimen
- *

- */ - public static final ReferenceClientParam SPECIMEN = new ReferenceClientParam(SP_SPECIMEN); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Observation.specimen". - */ - public static final Include INCLUDE_SPECIMEN = new Include("Observation.specimen"); - - /** - * Search parameter constant for related-type - *

- * Description:
- * Type: token
- * Path: Observation.related.type
- *

- */ - @SearchParamDefinition(name="related-type", path="Observation.related.type", description="", type="token" ) - public static final String SP_RELATED_TYPE = "related-type"; - - /** - * Fluent Client search parameter constant for related-type - *

- * Description:
- * Type: token
- * Path: Observation.related.type
- *

- */ - public static final TokenClientParam RELATED_TYPE = new TokenClientParam(SP_RELATED_TYPE); - - /** - * Search parameter constant for related-target - *

- * Description:
- * Type: reference
- * Path: Observation.related.target
- *

- */ - @SearchParamDefinition(name="related-target", path="Observation.related.target", description="", type="reference" ) - public static final String SP_RELATED_TARGET = "related-target"; - - /** - * Fluent Client search parameter constant for related-target - *

- * Description:
- * Type: reference
- * Path: Observation.related.target
- *

- */ - public static final ReferenceClientParam RELATED_TARGET = new ReferenceClientParam(SP_RELATED_TARGET); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Observation.related.target". - */ - public static final Include INCLUDE_RELATED_TARGET = new Include("Observation.related.target"); - - /** - * Search parameter constant for name-value-quantity - *

- * Description: Both name and one of the value parameters
- * Type: composite
- * Path: name & value-[x]
- *

- */ - @SearchParamDefinition(name="name-value-quantity", path="name & value-[x]", description="Both name and one of the value parameters", type="composite" , compositeOf={ "name", "value-quantity" } ) - public static final String SP_NAME_VALUE_QUANTITY = "name-value-quantity"; - - /** - * Fluent Client search parameter constant for name-value-quantity - *

- * Description: Both name and one of the value parameters
- * Type: composite
- * Path: name & value-[x]
- *

- */ - public static final CompositeClientParam NAME_VALUE_QUANTITY = new CompositeClientParam(SP_NAME_VALUE_QUANTITY); - - /** - * Search parameter constant for name-value-concept - *

- * Description: Both name and one of the value parameters
- * Type: composite
- * Path: name & value-[x]
- *

- */ - @SearchParamDefinition(name="name-value-concept", path="name & value-[x]", description="Both name and one of the value parameters", type="composite" , compositeOf={ "name", "value-concept" } ) - public static final String SP_NAME_VALUE_CONCEPT = "name-value-concept"; - - /** - * Fluent Client search parameter constant for name-value-concept - *

- * Description: Both name and one of the value parameters
- * Type: composite
- * Path: name & value-[x]
- *

- */ - public static final CompositeClientParam NAME_VALUE_CONCEPT = new CompositeClientParam(SP_NAME_VALUE_CONCEPT); - - /** - * Search parameter constant for name-value-date - *

- * Description: Both name and one of the value parameters
- * Type: composite
- * Path: name & value-[x]
- *

- */ - @SearchParamDefinition(name="name-value-date", path="name & value-[x]", description="Both name and one of the value parameters", type="composite" , compositeOf={ "name", "value-date" } ) - public static final String SP_NAME_VALUE_DATE = "name-value-date"; - - /** - * Fluent Client search parameter constant for name-value-date - *

- * Description: Both name and one of the value parameters
- * Type: composite
- * Path: name & value-[x]
- *

- */ - public static final CompositeClientParam NAME_VALUE_DATE = new CompositeClientParam(SP_NAME_VALUE_DATE); - - /** - * Search parameter constant for name-value-string - *

- * Description: Both name and one of the value parameters
- * Type: composite
- * Path: name & value-[x]
- *

- */ - @SearchParamDefinition(name="name-value-string", path="name & value-[x]", description="Both name and one of the value parameters", type="composite" , compositeOf={ "name", "value-string" } ) - public static final String SP_NAME_VALUE_STRING = "name-value-string"; - - /** - * Fluent Client search parameter constant for name-value-string - *

- * Description: Both name and one of the value parameters
- * Type: composite
- * Path: name & value-[x]
- *

- */ - public static final CompositeClientParam NAME_VALUE_STRING = new CompositeClientParam(SP_NAME_VALUE_STRING); - - /** - * Search parameter constant for related-target-related-type - *

- * Description: Related Observations - search on related-type and related-target together
- * Type: composite
- * Path: related-target & related-type
- *

- */ - @SearchParamDefinition(name="related-target-related-type", path="related-target & related-type", description="Related Observations - search on related-type and related-target together", type="composite" , compositeOf={ "related-target", "related-type" } ) - public static final String SP_RELATED_TARGET_RELATED_TYPE = "related-target-related-type"; - - /** - * Fluent Client search parameter constant for related-target-related-type - *

- * Description: Related Observations - search on related-type and related-target together
- * Type: composite
- * Path: related-target & related-type
- *

- */ - public static final CompositeClientParam RELATED_TARGET_RELATED_TYPE = new CompositeClientParam(SP_RELATED_TARGET_RELATED_TYPE); - - - @Child(name="name", type=CodeableConceptDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Type of observation (code / type)", - formalDefinition="Describes what was observed. Sometimes this is called the observation \"code\"" - ) - private CodeableConceptDt myName; - - @Child(name="value", order=1, min=0, max=1, type={ - QuantityDt.class, CodeableConceptDt.class, AttachmentDt.class, RatioDt.class, PeriodDt.class, SampledDataDt.class, StringDt.class }) - @Description( - shortDefinition="Actual result", - formalDefinition="The information determined as a result of making the observation, if the information has a simple value" - ) - private IDatatype myValue; - - @Child(name="interpretation", type=CodeableConceptDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="High, low, normal, etc.", - formalDefinition="The assessment made based on the result of the observation." - ) - private BoundCodeableConceptDt myInterpretation; - - @Child(name="comments", type=StringDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Comments about result", - formalDefinition="May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result." - ) - private StringDt myComments; - - @Child(name="applies", order=4, min=0, max=1, type={ - DateTimeDt.class, PeriodDt.class }) - @Description( - shortDefinition="Physiologically Relevant time/time-period for observation", - formalDefinition="The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the \"physiologically relevant time\". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself" - ) - private IDatatype myApplies; - - @Child(name="issued", type=InstantDt.class, order=5, min=0, max=1) - @Description( - shortDefinition="Date/Time this was made available", - formalDefinition="" - ) - private InstantDt myIssued; - - @Child(name="status", type=CodeDt.class, order=6, min=1, max=1) - @Description( - shortDefinition="registered | preliminary | final | amended +", - formalDefinition="The status of the result value" - ) - private BoundCodeDt myStatus; - - @Child(name="reliability", type=CodeDt.class, order=7, min=1, max=1) - @Description( - shortDefinition="ok | ongoing | early | questionable | calibrating | error +", - formalDefinition="An estimate of the degree to which quality issues have impacted on the value reported" - ) - private BoundCodeDt myReliability; - - @Child(name="bodySite", type=CodeableConceptDt.class, order=8, min=0, max=1) - @Description( - shortDefinition="Observed body part", - formalDefinition="Indicates where on the subject's body the observation was made." - ) - private CodeableConceptDt myBodySite; - - @Child(name="method", type=CodeableConceptDt.class, order=9, min=0, max=1) - @Description( - shortDefinition="How it was done", - formalDefinition="Indicates the mechanism used to perform the observation" - ) - private CodeableConceptDt myMethod; - - @Child(name="identifier", type=IdentifierDt.class, order=10, min=0, max=1) - @Description( - shortDefinition="Unique Id for this particular observation", - formalDefinition="A unique identifier for the simple observation" - ) - private IdentifierDt myIdentifier; - - @Child(name="subject", order=11, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.Group.class, ca.uhn.fhir.model.dstu.resource.Device.class, ca.uhn.fhir.model.dstu.resource.Location.class }) - @Description( - shortDefinition="Who and/or what this is about", - formalDefinition="The thing the observation is being made about" - ) - private ResourceReferenceDt mySubject; - - @Child(name="specimen", order=12, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Specimen.class }) - @Description( - shortDefinition="Specimen used for this observation", - formalDefinition="The specimen that was used when this observation was made" - ) - private ResourceReferenceDt mySpecimen; - - @Child(name="performer", order=13, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Device.class, ca.uhn.fhir.model.dstu.resource.Organization.class }) - @Description( - shortDefinition="Who did the observation", - formalDefinition="Who was responsible for asserting the observed value as \"true\"" - ) - private java.util.List myPerformer; - - @Child(name="referenceRange", order=14, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Provides guide for interpretation", - formalDefinition="Guidance on how to interpret the value by comparison to a normal or recommended range" - ) - private java.util.List myReferenceRange; - - @Child(name="related", order=15, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Observations related to this observation", - formalDefinition="Related observations - either components, or previous observations, or statements of derivation" - ) - private java.util.List myRelated; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myName, myValue, myInterpretation, myComments, myApplies, myIssued, myStatus, myReliability, myBodySite, myMethod, myIdentifier, mySubject, mySpecimen, myPerformer, myReferenceRange, myRelated); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myName, myValue, myInterpretation, myComments, myApplies, myIssued, myStatus, myReliability, myBodySite, myMethod, myIdentifier, mySubject, mySpecimen, myPerformer, myReferenceRange, myRelated); - } - - /** - * Gets the value(s) for name (Type of observation (code / type)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Describes what was observed. Sometimes this is called the observation \"code\" - *

- */ - public CodeableConceptDt getName() { - if (myName == null) { - myName = new CodeableConceptDt(); - } - return myName; - } - - /** - * Sets the value(s) for name (Type of observation (code / type)) - * - *

- * Definition: - * Describes what was observed. Sometimes this is called the observation \"code\" - *

- */ - public Observation setName(CodeableConceptDt theValue) { - myName = theValue; - return this; - } - - - /** - * Gets the value(s) for value[x] (Actual result). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The information determined as a result of making the observation, if the information has a simple value - *

- */ - public IDatatype getValue() { - return myValue; - } - - /** - * Sets the value(s) for value[x] (Actual result) - * - *

- * Definition: - * The information determined as a result of making the observation, if the information has a simple value - *

- */ - public Observation setValue(IDatatype theValue) { - myValue = theValue; - return this; - } - - - /** - * Gets the value(s) for interpretation (High, low, normal, etc.). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The assessment made based on the result of the observation. - *

- */ - public BoundCodeableConceptDt getInterpretation() { - if (myInterpretation == null) { - myInterpretation = new BoundCodeableConceptDt(ObservationInterpretationCodesEnum.VALUESET_BINDER); - } - return myInterpretation; - } - - /** - * Sets the value(s) for interpretation (High, low, normal, etc.) - * - *

- * Definition: - * The assessment made based on the result of the observation. - *

- */ - public Observation setInterpretation(BoundCodeableConceptDt theValue) { - myInterpretation = theValue; - return this; - } - - /** - * Sets the value(s) for interpretation (High, low, normal, etc.) - * - *

- * Definition: - * The assessment made based on the result of the observation. - *

- */ - public Observation setInterpretation(ObservationInterpretationCodesEnum theValue) { - getInterpretation().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for comments (Comments about result). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result. - *

- */ - public StringDt getComments() { - if (myComments == null) { - myComments = new StringDt(); - } - return myComments; - } - - /** - * Sets the value(s) for comments (Comments about result) - * - *

- * Definition: - * May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result. - *

- */ - public Observation setComments(StringDt theValue) { - myComments = theValue; - return this; - } - - /** - * Sets the value for comments (Comments about result) - * - *

- * Definition: - * May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result. - *

- */ - public Observation setComments( String theString) { - myComments = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for applies[x] (Physiologically Relevant time/time-period for observation). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the \"physiologically relevant time\". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself - *

- */ - public IDatatype getApplies() { - return myApplies; - } - - /** - * Sets the value(s) for applies[x] (Physiologically Relevant time/time-period for observation) - * - *

- * Definition: - * The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the \"physiologically relevant time\". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself - *

- */ - public Observation setApplies(IDatatype theValue) { - myApplies = theValue; - return this; - } - - - /** - * Gets the value(s) for issued (Date/Time this was made available). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public InstantDt getIssued() { - if (myIssued == null) { - myIssued = new InstantDt(); - } - return myIssued; - } - - /** - * Sets the value(s) for issued (Date/Time this was made available) - * - *

- * Definition: - * - *

- */ - public Observation setIssued(InstantDt theValue) { - myIssued = theValue; - return this; - } - - /** - * Sets the value for issued (Date/Time this was made available) - * - *

- * Definition: - * - *

- */ - public Observation setIssued( Date theDate, TemporalPrecisionEnum thePrecision) { - myIssued = new InstantDt(theDate, thePrecision); - return this; - } - - /** - * Sets the value for issued (Date/Time this was made available) - * - *

- * Definition: - * - *

- */ - public Observation setIssuedWithMillisPrecision( Date theDate) { - myIssued = new InstantDt(theDate); - return this; - } - - - /** - * Gets the value(s) for status (registered | preliminary | final | amended +). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The status of the result value - *

- */ - public BoundCodeDt getStatus() { - if (myStatus == null) { - myStatus = new BoundCodeDt(ObservationStatusEnum.VALUESET_BINDER); - } - return myStatus; - } - - /** - * Sets the value(s) for status (registered | preliminary | final | amended +) - * - *

- * Definition: - * The status of the result value - *

- */ - public Observation setStatus(BoundCodeDt theValue) { - myStatus = theValue; - return this; - } - - /** - * Sets the value(s) for status (registered | preliminary | final | amended +) - * - *

- * Definition: - * The status of the result value - *

- */ - public Observation setStatus(ObservationStatusEnum theValue) { - getStatus().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for reliability (ok | ongoing | early | questionable | calibrating | error +). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * An estimate of the degree to which quality issues have impacted on the value reported - *

- */ - public BoundCodeDt getReliability() { - if (myReliability == null) { - myReliability = new BoundCodeDt(ObservationReliabilityEnum.VALUESET_BINDER); - } - return myReliability; - } - - /** - * Sets the value(s) for reliability (ok | ongoing | early | questionable | calibrating | error +) - * - *

- * Definition: - * An estimate of the degree to which quality issues have impacted on the value reported - *

- */ - public Observation setReliability(BoundCodeDt theValue) { - myReliability = theValue; - return this; - } - - /** - * Sets the value(s) for reliability (ok | ongoing | early | questionable | calibrating | error +) - * - *

- * Definition: - * An estimate of the degree to which quality issues have impacted on the value reported - *

- */ - public Observation setReliability(ObservationReliabilityEnum theValue) { - getReliability().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for bodySite (Observed body part). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates where on the subject's body the observation was made. - *

- */ - public CodeableConceptDt getBodySite() { - if (myBodySite == null) { - myBodySite = new CodeableConceptDt(); - } - return myBodySite; - } - - /** - * Sets the value(s) for bodySite (Observed body part) - * - *

- * Definition: - * Indicates where on the subject's body the observation was made. - *

- */ - public Observation setBodySite(CodeableConceptDt theValue) { - myBodySite = theValue; - return this; - } - - - /** - * Gets the value(s) for method (How it was done). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates the mechanism used to perform the observation - *

- */ - public CodeableConceptDt getMethod() { - if (myMethod == null) { - myMethod = new CodeableConceptDt(); - } - return myMethod; - } - - /** - * Sets the value(s) for method (How it was done) - * - *

- * Definition: - * Indicates the mechanism used to perform the observation - *

- */ - public Observation setMethod(CodeableConceptDt theValue) { - myMethod = theValue; - return this; - } - - - /** - * Gets the value(s) for identifier (Unique Id for this particular observation). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A unique identifier for the simple observation - *

- */ - public IdentifierDt getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new IdentifierDt(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Unique Id for this particular observation) - * - *

- * Definition: - * A unique identifier for the simple observation - *

- */ - public Observation setIdentifier(IdentifierDt theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Sets the value for identifier (Unique Id for this particular observation) - * - *

- * Definition: - * A unique identifier for the simple observation - *

- */ - public Observation setIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - myIdentifier = new IdentifierDt(theUse, theSystem, theValue, theLabel); - return this; - } - - /** - * Sets the value for identifier (Unique Id for this particular observation) - * - *

- * Definition: - * A unique identifier for the simple observation - *

- */ - public Observation setIdentifier( String theSystem, String theValue) { - myIdentifier = new IdentifierDt(theSystem, theValue); - return this; - } - - - /** - * Gets the value(s) for subject (Who and/or what this is about). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The thing the observation is being made about - *

- */ - public ResourceReferenceDt getSubject() { - if (mySubject == null) { - mySubject = new ResourceReferenceDt(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (Who and/or what this is about) - * - *

- * Definition: - * The thing the observation is being made about - *

- */ - public Observation setSubject(ResourceReferenceDt theValue) { - mySubject = theValue; - return this; - } - - - /** - * Gets the value(s) for specimen (Specimen used for this observation). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The specimen that was used when this observation was made - *

- */ - public ResourceReferenceDt getSpecimen() { - if (mySpecimen == null) { - mySpecimen = new ResourceReferenceDt(); - } - return mySpecimen; - } - - /** - * Sets the value(s) for specimen (Specimen used for this observation) - * - *

- * Definition: - * The specimen that was used when this observation was made - *

- */ - public Observation setSpecimen(ResourceReferenceDt theValue) { - mySpecimen = theValue; - return this; - } - - - /** - * Gets the value(s) for performer (Who did the observation). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getPerformer() { - if (myPerformer == null) { - myPerformer = new java.util.ArrayList(); - } - return myPerformer; - } - - /** - * Sets the value(s) for performer (Who did the observation) - * - *

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

- */ - public Observation setPerformer(java.util.List theValue) { - myPerformer = theValue; - return this; - } - - /** - * Adds and returns a new value for performer (Who did the observation) - * - *

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

- */ - public ResourceReferenceDt addPerformer() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getPerformer().add(newType); - return newType; - } - - /** - * Gets the value(s) for referenceRange (Provides guide for interpretation). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getReferenceRange() { - if (myReferenceRange == null) { - myReferenceRange = new java.util.ArrayList(); - } - return myReferenceRange; - } - - /** - * Sets the value(s) for referenceRange (Provides guide for interpretation) - * - *

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

- */ - public Observation setReferenceRange(java.util.List theValue) { - myReferenceRange = theValue; - return this; - } - - /** - * Adds and returns a new value for referenceRange (Provides guide for interpretation) - * - *

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

- */ - public ReferenceRange addReferenceRange() { - ReferenceRange newType = new ReferenceRange(); - getReferenceRange().add(newType); - return newType; - } - - /** - * Gets the first repetition for referenceRange (Provides guide for interpretation), - * creating it if it does not already exist. - * - *

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

- */ - public ReferenceRange getReferenceRangeFirstRep() { - if (getReferenceRange().isEmpty()) { - return addReferenceRange(); - } - return getReferenceRange().get(0); - } - - /** - * Gets the value(s) for related (Observations related to this observation). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getRelated() { - if (myRelated == null) { - myRelated = new java.util.ArrayList(); - } - return myRelated; - } - - /** - * Sets the value(s) for related (Observations related to this observation) - * - *

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

- */ - public Observation setRelated(java.util.List theValue) { - myRelated = theValue; - return this; - } - - /** - * Adds and returns a new value for related (Observations related to this observation) - * - *

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

- */ - public Related addRelated() { - Related newType = new Related(); - getRelated().add(newType); - return newType; - } - - /** - * Gets the first repetition for related (Observations related to this observation), - * creating it if it does not already exist. - * - *

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

- */ - public Related getRelatedFirstRep() { - if (getRelated().isEmpty()) { - return addRelated(); - } - return getRelated().get(0); - } - - /** - * Block class for child element: Observation.referenceRange (Provides guide for interpretation) - * - *

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

- */ - @Block() - public static class ReferenceRange extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="low", type=QuantityDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Low Range, if relevant", - formalDefinition="The value of the low bound of the reference range. If this is omitted, the low bound of the reference range is assumed to be meaningless. E.g. <2.3" - ) - private QuantityDt myLow; - - @Child(name="high", type=QuantityDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="High Range, if relevant", - formalDefinition="The value of the high bound of the reference range. If this is omitted, the high bound of the reference range is assumed to be meaningless. E.g. >5" - ) - private QuantityDt myHigh; - - @Child(name="meaning", type=CodeableConceptDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Indicates the meaning/use of this range of this range", - formalDefinition="Code for the meaning of the reference range" - ) - private CodeableConceptDt myMeaning; - - @Child(name="age", type=RangeDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Applicable age range, if relevant", - formalDefinition="The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so" - ) - private RangeDt myAge; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myLow, myHigh, myMeaning, myAge); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myLow, myHigh, myMeaning, myAge); - } - - /** - * Gets the value(s) for low (Low Range, if relevant). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The value of the low bound of the reference range. If this is omitted, the low bound of the reference range is assumed to be meaningless. E.g. <2.3 - *

- */ - public QuantityDt getLow() { - if (myLow == null) { - myLow = new QuantityDt(); - } - return myLow; - } - - /** - * Sets the value(s) for low (Low Range, if relevant) - * - *

- * Definition: - * The value of the low bound of the reference range. If this is omitted, the low bound of the reference range is assumed to be meaningless. E.g. <2.3 - *

- */ - public ReferenceRange setLow(QuantityDt theValue) { - myLow = theValue; - return this; - } - - /** - * Sets the value for low (Low Range, if relevant) - * - *

- * Definition: - * The value of the low bound of the reference range. If this is omitted, the low bound of the reference range is assumed to be meaningless. E.g. <2.3 - *

- */ - public ReferenceRange setLow( QuantityCompararatorEnum theComparator, double theValue, String theUnits) { - myLow = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for low (Low Range, if relevant) - * - *

- * Definition: - * The value of the low bound of the reference range. If this is omitted, the low bound of the reference range is assumed to be meaningless. E.g. <2.3 - *

- */ - public ReferenceRange setLow( QuantityCompararatorEnum theComparator, long theValue, String theUnits) { - myLow = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for low (Low Range, if relevant) - * - *

- * Definition: - * The value of the low bound of the reference range. If this is omitted, the low bound of the reference range is assumed to be meaningless. E.g. <2.3 - *

- */ - public ReferenceRange setLow( QuantityCompararatorEnum theComparator, double theValue, String theSystem, String theUnits) { - myLow = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for low (Low Range, if relevant) - * - *

- * Definition: - * The value of the low bound of the reference range. If this is omitted, the low bound of the reference range is assumed to be meaningless. E.g. <2.3 - *

- */ - public ReferenceRange setLow( QuantityCompararatorEnum theComparator, long theValue, String theSystem, String theUnits) { - myLow = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for low (Low Range, if relevant) - * - *

- * Definition: - * The value of the low bound of the reference range. If this is omitted, the low bound of the reference range is assumed to be meaningless. E.g. <2.3 - *

- */ - public ReferenceRange setLow( double theValue) { - myLow = new QuantityDt(theValue); - return this; - } - - /** - * Sets the value for low (Low Range, if relevant) - * - *

- * Definition: - * The value of the low bound of the reference range. If this is omitted, the low bound of the reference range is assumed to be meaningless. E.g. <2.3 - *

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

- * Definition: - * The value of the high bound of the reference range. If this is omitted, the high bound of the reference range is assumed to be meaningless. E.g. >5 - *

- */ - public QuantityDt getHigh() { - if (myHigh == null) { - myHigh = new QuantityDt(); - } - return myHigh; - } - - /** - * Sets the value(s) for high (High Range, if relevant) - * - *

- * Definition: - * The value of the high bound of the reference range. If this is omitted, the high bound of the reference range is assumed to be meaningless. E.g. >5 - *

- */ - public ReferenceRange setHigh(QuantityDt theValue) { - myHigh = theValue; - return this; - } - - /** - * Sets the value for high (High Range, if relevant) - * - *

- * Definition: - * The value of the high bound of the reference range. If this is omitted, the high bound of the reference range is assumed to be meaningless. E.g. >5 - *

- */ - public ReferenceRange setHigh( QuantityCompararatorEnum theComparator, double theValue, String theUnits) { - myHigh = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for high (High Range, if relevant) - * - *

- * Definition: - * The value of the high bound of the reference range. If this is omitted, the high bound of the reference range is assumed to be meaningless. E.g. >5 - *

- */ - public ReferenceRange setHigh( QuantityCompararatorEnum theComparator, long theValue, String theUnits) { - myHigh = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for high (High Range, if relevant) - * - *

- * Definition: - * The value of the high bound of the reference range. If this is omitted, the high bound of the reference range is assumed to be meaningless. E.g. >5 - *

- */ - public ReferenceRange setHigh( QuantityCompararatorEnum theComparator, double theValue, String theSystem, String theUnits) { - myHigh = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for high (High Range, if relevant) - * - *

- * Definition: - * The value of the high bound of the reference range. If this is omitted, the high bound of the reference range is assumed to be meaningless. E.g. >5 - *

- */ - public ReferenceRange setHigh( QuantityCompararatorEnum theComparator, long theValue, String theSystem, String theUnits) { - myHigh = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for high (High Range, if relevant) - * - *

- * Definition: - * The value of the high bound of the reference range. If this is omitted, the high bound of the reference range is assumed to be meaningless. E.g. >5 - *

- */ - public ReferenceRange setHigh( double theValue) { - myHigh = new QuantityDt(theValue); - return this; - } - - /** - * Sets the value for high (High Range, if relevant) - * - *

- * Definition: - * The value of the high bound of the reference range. If this is omitted, the high bound of the reference range is assumed to be meaningless. E.g. >5 - *

- */ - public ReferenceRange setHigh( long theValue) { - myHigh = new QuantityDt(theValue); - return this; - } - - - /** - * Gets the value(s) for meaning (Indicates the meaning/use of this range of this range). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Code for the meaning of the reference range - *

- */ - public CodeableConceptDt getMeaning() { - if (myMeaning == null) { - myMeaning = new CodeableConceptDt(); - } - return myMeaning; - } - - /** - * Sets the value(s) for meaning (Indicates the meaning/use of this range of this range) - * - *

- * Definition: - * Code for the meaning of the reference range - *

- */ - public ReferenceRange setMeaning(CodeableConceptDt theValue) { - myMeaning = theValue; - return this; - } - - - /** - * Gets the value(s) for age (Applicable age range, if relevant). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so - *

- */ - public RangeDt getAge() { - if (myAge == null) { - myAge = new RangeDt(); - } - return myAge; - } - - /** - * Sets the value(s) for age (Applicable age range, if relevant) - * - *

- * Definition: - * The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so - *

- */ - public ReferenceRange setAge(RangeDt theValue) { - myAge = theValue; - return this; - } - - - - } - - - /** - * Block class for child element: Observation.related (Observations related to this observation) - * - *

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

- */ - @Block() - public static class Related extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="type", type=CodeDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="has-component | has-member | derived-from | sequel-to | replaces | qualified-by | interfered-by", - formalDefinition="A code specifying the kind of relationship that exists with the target observation" - ) - private BoundCodeDt myType; - - @Child(name="target", order=1, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Observation.class }) - @Description( - shortDefinition="Observation that is related to this one", - formalDefinition="A reference to the observation that is related to this observation" - ) - private ResourceReferenceDt myTarget; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myType, myTarget); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myType, myTarget); - } - - /** - * Gets the value(s) for type (has-component | has-member | derived-from | sequel-to | replaces | qualified-by | interfered-by). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A code specifying the kind of relationship that exists with the target observation - *

- */ - public BoundCodeDt getType() { - if (myType == null) { - myType = new BoundCodeDt(ObservationRelationshipTypeEnum.VALUESET_BINDER); - } - return myType; - } - - /** - * Sets the value(s) for type (has-component | has-member | derived-from | sequel-to | replaces | qualified-by | interfered-by) - * - *

- * Definition: - * A code specifying the kind of relationship that exists with the target observation - *

- */ - public Related setType(BoundCodeDt theValue) { - myType = theValue; - return this; - } - - /** - * Sets the value(s) for type (has-component | has-member | derived-from | sequel-to | replaces | qualified-by | interfered-by) - * - *

- * Definition: - * A code specifying the kind of relationship that exists with the target observation - *

- */ - public Related setType(ObservationRelationshipTypeEnum theValue) { - getType().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for target (Observation that is related to this one). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A reference to the observation that is related to this observation - *

- */ - public ResourceReferenceDt getTarget() { - if (myTarget == null) { - myTarget = new ResourceReferenceDt(); - } - return myTarget; - } - - /** - * Sets the value(s) for target (Observation that is related to this one) - * - *

- * Definition: - * A reference to the observation that is related to this observation - *

- */ - public Related setTarget(ResourceReferenceDt theValue) { - myTarget = theValue; - return this; - } - - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/OperationOutcome.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/OperationOutcome.java deleted file mode 100644 index 7ca704f5aeb..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/OperationOutcome.java +++ /dev/null @@ -1,413 +0,0 @@ - - - - - - - - - - - - - - - - -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.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.annotation.Block; -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.Description; -import ca.uhn.fhir.model.api.annotation.ResourceDef; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.valueset.IssueSeverityEnum; -import ca.uhn.fhir.model.primitive.BoundCodeDt; -import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.StringDt; - - -/** - * HAPI/FHIR OperationOutcome Resource - * (Information about the success/failure of an action) - * - *

- * Definition: - * A collection of error, warning or information messages that result from a system action - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/OperationOutcome - *

- * - */ -@ResourceDef(name="OperationOutcome", profile="http://hl7.org/fhir/profiles/OperationOutcome", id="operationoutcome") -public class OperationOutcome extends BaseResource implements IResource { - - - @Child(name="issue", order=0, min=1, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="A single issue associated with the action", - formalDefinition="An error, warning or information message that results from a system action" - ) - private java.util.List myIssue; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIssue); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIssue); - } - - /** - * Gets the value(s) for issue (A single issue associated with the action). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * An error, warning or information message that results from a system action - *

- */ - public java.util.List getIssue() { - if (myIssue == null) { - myIssue = new java.util.ArrayList(); - } - return myIssue; - } - - /** - * Sets the value(s) for issue (A single issue associated with the action) - * - *

- * Definition: - * An error, warning or information message that results from a system action - *

- */ - public OperationOutcome setIssue(java.util.List theValue) { - myIssue = theValue; - return this; - } - - /** - * Adds and returns a new value for issue (A single issue associated with the action) - * - *

- * Definition: - * An error, warning or information message that results from a system action - *

- */ - public Issue addIssue() { - Issue newType = new Issue(); - getIssue().add(newType); - return newType; - } - - /** - * Gets the first repetition for issue (A single issue associated with the action), - * creating it if it does not already exist. - * - *

- * Definition: - * An error, warning or information message that results from a system action - *

- */ - public Issue getIssueFirstRep() { - if (getIssue().isEmpty()) { - return addIssue(); - } - return getIssue().get(0); - } - - /** - * Block class for child element: OperationOutcome.issue (A single issue associated with the action) - * - *

- * Definition: - * An error, warning or information message that results from a system action - *

- */ - @Block() - public static class Issue extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="severity", type=CodeDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="fatal | error | warning | information", - formalDefinition="Indicates whether the issue indicates a variation from successful processing" - ) - private BoundCodeDt mySeverity; - - @Child(name="type", type=CodingDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Error or warning code", - formalDefinition="A code indicating the type of error, warning or information message." - ) - private CodingDt myType; - - @Child(name="details", type=StringDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Additional description of the issue", - formalDefinition="Additional description of the issue" - ) - private StringDt myDetails; - - @Child(name="location", type=StringDt.class, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="XPath of element(s) related to issue", - formalDefinition="A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised." - ) - private java.util.List myLocation; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySeverity, myType, myDetails, myLocation); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySeverity, myType, myDetails, myLocation); - } - - /** - * Gets the value(s) for severity (fatal | error | warning | information). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates whether the issue indicates a variation from successful processing - *

- */ - public BoundCodeDt getSeverity() { - if (mySeverity == null) { - mySeverity = new BoundCodeDt(IssueSeverityEnum.VALUESET_BINDER); - } - return mySeverity; - } - - /** - * Sets the value(s) for severity (fatal | error | warning | information) - * - *

- * Definition: - * Indicates whether the issue indicates a variation from successful processing - *

- */ - public Issue setSeverity(BoundCodeDt theValue) { - mySeverity = theValue; - return this; - } - - /** - * Sets the value(s) for severity (fatal | error | warning | information) - * - *

- * Definition: - * Indicates whether the issue indicates a variation from successful processing - *

- */ - public Issue setSeverity(IssueSeverityEnum theValue) { - getSeverity().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for type (Error or warning code). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A code indicating the type of error, warning or information message. - *

- */ - public CodingDt getType() { - if (myType == null) { - myType = new CodingDt(); - } - return myType; - } - - /** - * Sets the value(s) for type (Error or warning code) - * - *

- * Definition: - * A code indicating the type of error, warning or information message. - *

- */ - public Issue setType(CodingDt theValue) { - myType = theValue; - return this; - } - - - /** - * Gets the value(s) for details (Additional description of the issue). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Additional description of the issue - *

- */ - public StringDt getDetails() { - if (myDetails == null) { - myDetails = new StringDt(); - } - return myDetails; - } - - /** - * Sets the value(s) for details (Additional description of the issue) - * - *

- * Definition: - * Additional description of the issue - *

- */ - public Issue setDetails(StringDt theValue) { - myDetails = theValue; - return this; - } - - /** - * Sets the value for details (Additional description of the issue) - * - *

- * Definition: - * Additional description of the issue - *

- */ - public Issue setDetails( String theString) { - myDetails = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for location (XPath of element(s) related to issue). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised. - *

- */ - public java.util.List getLocation() { - if (myLocation == null) { - myLocation = new java.util.ArrayList(); - } - return myLocation; - } - - /** - * Sets the value(s) for location (XPath of element(s) related to issue) - * - *

- * Definition: - * A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised. - *

- */ - public Issue setLocation(java.util.List theValue) { - myLocation = theValue; - return this; - } - - /** - * Adds and returns a new value for location (XPath of element(s) related to issue) - * - *

- * Definition: - * A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised. - *

- */ - public StringDt addLocation() { - StringDt newType = new StringDt(); - getLocation().add(newType); - return newType; - } - - /** - * Gets the first repetition for location (XPath of element(s) related to issue), - * creating it if it does not already exist. - * - *

- * Definition: - * A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised. - *

- */ - public StringDt getLocationFirstRep() { - if (getLocation().isEmpty()) { - return addLocation(); - } - return getLocation().get(0); - } - /** - * Adds a new value for location (XPath of element(s) related to issue) - * - *

- * Definition: - * A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised. - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Issue addLocation( String theString) { - if (myLocation == null) { - myLocation = new java.util.ArrayList(); - } - myLocation.add(new StringDt(theString)); - return this; - } - - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Order.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Order.java deleted file mode 100644 index 93413f13bf7..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Order.java +++ /dev/null @@ -1,853 +0,0 @@ - - - - - - - - - - - - - - - - -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.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.composite.ScheduleDt; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.rest.gclient.DateClientParam; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR Order Resource - * (A request to perform an action) - * - *

- * Definition: - * - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Order - *

- * - */ -@ResourceDef(name="Order", profile="http://hl7.org/fhir/profiles/Order", id="order") -public class Order extends BaseResource implements IResource { - - /** - * Search parameter constant for date - *

- * Description:
- * Type: date
- * Path: Order.date
- *

- */ - @SearchParamDefinition(name="date", path="Order.date", description="", type="date" ) - public static final String SP_DATE = "date"; - - /** - * Fluent Client search parameter constant for date - *

- * Description:
- * Type: date
- * Path: Order.date
- *

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

- * Description:
- * Type: reference
- * Path: Order.subject
- *

- */ - @SearchParamDefinition(name="subject", path="Order.subject", description="", type="reference" ) - public static final String SP_SUBJECT = "subject"; - - /** - * Fluent Client search parameter constant for subject - *

- * Description:
- * Type: reference
- * Path: Order.subject
- *

- */ - public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Order.subject". - */ - public static final Include INCLUDE_SUBJECT = new Include("Order.subject"); - - /** - * Search parameter constant for source - *

- * Description:
- * Type: reference
- * Path: Order.source
- *

- */ - @SearchParamDefinition(name="source", path="Order.source", description="", type="reference" ) - public static final String SP_SOURCE = "source"; - - /** - * Fluent Client search parameter constant for source - *

- * Description:
- * Type: reference
- * Path: Order.source
- *

- */ - public static final ReferenceClientParam SOURCE = new ReferenceClientParam(SP_SOURCE); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Order.source". - */ - public static final Include INCLUDE_SOURCE = new Include("Order.source"); - - /** - * Search parameter constant for target - *

- * Description:
- * Type: reference
- * Path: Order.target
- *

- */ - @SearchParamDefinition(name="target", path="Order.target", description="", type="reference" ) - public static final String SP_TARGET = "target"; - - /** - * Fluent Client search parameter constant for target - *

- * Description:
- * Type: reference
- * Path: Order.target
- *

- */ - public static final ReferenceClientParam TARGET = new ReferenceClientParam(SP_TARGET); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Order.target". - */ - public static final Include INCLUDE_TARGET = new Include("Order.target"); - - /** - * Search parameter constant for authority - *

- * Description:
- * Type: reference
- * Path: Order.authority
- *

- */ - @SearchParamDefinition(name="authority", path="Order.authority", description="", type="reference" ) - public static final String SP_AUTHORITY = "authority"; - - /** - * Fluent Client search parameter constant for authority - *

- * Description:
- * Type: reference
- * Path: Order.authority
- *

- */ - public static final ReferenceClientParam AUTHORITY = new ReferenceClientParam(SP_AUTHORITY); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Order.authority". - */ - public static final Include INCLUDE_AUTHORITY = new Include("Order.authority"); - - /** - * Search parameter constant for when_code - *

- * Description:
- * Type: token
- * Path: Order.when.code
- *

- */ - @SearchParamDefinition(name="when_code", path="Order.when.code", description="", type="token" ) - public static final String SP_WHEN_CODE = "when_code"; - - /** - * Fluent Client search parameter constant for when_code - *

- * Description:
- * Type: token
- * Path: Order.when.code
- *

- */ - public static final TokenClientParam WHEN_CODE = new TokenClientParam(SP_WHEN_CODE); - - /** - * Search parameter constant for when - *

- * Description:
- * Type: date
- * Path: Order.when.schedule
- *

- */ - @SearchParamDefinition(name="when", path="Order.when.schedule", description="", type="date" ) - public static final String SP_WHEN = "when"; - - /** - * Fluent Client search parameter constant for when - *

- * Description:
- * Type: date
- * Path: Order.when.schedule
- *

- */ - public static final DateClientParam WHEN = new DateClientParam(SP_WHEN); - - /** - * Search parameter constant for detail - *

- * Description:
- * Type: reference
- * Path: Order.detail
- *

- */ - @SearchParamDefinition(name="detail", path="Order.detail", description="", type="reference" ) - public static final String SP_DETAIL = "detail"; - - /** - * Fluent Client search parameter constant for detail - *

- * Description:
- * Type: reference
- * Path: Order.detail
- *

- */ - public static final ReferenceClientParam DETAIL = new ReferenceClientParam(SP_DETAIL); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Order.detail". - */ - public static final Include INCLUDE_DETAIL = new Include("Order.detail"); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Identifiers assigned to this order by the orderer or by the receiver", - formalDefinition="" - ) - private java.util.List myIdentifier; - - @Child(name="date", type=DateTimeDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="When the order was made", - formalDefinition="" - ) - private DateTimeDt myDate; - - @Child(name="subject", order=2, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="Patient this order is about", - formalDefinition="" - ) - private ResourceReferenceDt mySubject; - - @Child(name="source", order=3, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class }) - @Description( - shortDefinition="Who initiated the order", - formalDefinition="" - ) - private ResourceReferenceDt mySource; - - @Child(name="target", order=4, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Organization.class, ca.uhn.fhir.model.dstu.resource.Device.class, ca.uhn.fhir.model.dstu.resource.Practitioner.class }) - @Description( - shortDefinition="Who is intended to fulfill the order", - formalDefinition="" - ) - private ResourceReferenceDt myTarget; - - @Child(name="reason", order=5, min=0, max=1, type={ - CodeableConceptDt.class, IResource.class }) - @Description( - shortDefinition="Text - why the order was made", - formalDefinition="" - ) - private IDatatype myReason; - - @Child(name="authority", order=6, min=0, max=1, type={ - IResource.class }) - @Description( - shortDefinition="If required by policy", - formalDefinition="" - ) - private ResourceReferenceDt myAuthority; - - @Child(name="when", order=7, min=0, max=1) - @Description( - shortDefinition="When order should be fulfilled", - formalDefinition="" - ) - private When myWhen; - - @Child(name="detail", order=8, min=1, max=Child.MAX_UNLIMITED, type={ - IResource.class }) - @Description( - shortDefinition="What action is being ordered", - formalDefinition="" - ) - private java.util.List myDetail; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myDate, mySubject, mySource, myTarget, myReason, myAuthority, myWhen, myDetail); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myDate, mySubject, mySource, myTarget, myReason, myAuthority, myWhen, myDetail); - } - - /** - * Gets the value(s) for identifier (Identifiers assigned to this order by the orderer or by the receiver). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Identifiers assigned to this order by the orderer or by the receiver) - * - *

- * Definition: - * - *

- */ - public Order setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (Identifiers assigned to this order by the orderer or by the receiver) - * - *

- * Definition: - * - *

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (Identifiers assigned to this order by the orderer or by the receiver), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (Identifiers assigned to this order by the orderer or by the receiver) - * - *

- * Definition: - * - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Order addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (Identifiers assigned to this order by the orderer or by the receiver) - * - *

- * Definition: - * - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Order addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for date (When the order was made). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public DateTimeDt getDate() { - if (myDate == null) { - myDate = new DateTimeDt(); - } - return myDate; - } - - /** - * Sets the value(s) for date (When the order was made) - * - *

- * Definition: - * - *

- */ - public Order setDate(DateTimeDt theValue) { - myDate = theValue; - return this; - } - - /** - * Sets the value for date (When the order was made) - * - *

- * Definition: - * - *

- */ - public Order setDateWithSecondsPrecision( Date theDate) { - myDate = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for date (When the order was made) - * - *

- * Definition: - * - *

- */ - public Order setDate( Date theDate, TemporalPrecisionEnum thePrecision) { - myDate = new DateTimeDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for subject (Patient this order is about). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt getSubject() { - if (mySubject == null) { - mySubject = new ResourceReferenceDt(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (Patient this order is about) - * - *

- * Definition: - * - *

- */ - public Order setSubject(ResourceReferenceDt theValue) { - mySubject = theValue; - return this; - } - - - /** - * Gets the value(s) for source (Who initiated the order). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt getSource() { - if (mySource == null) { - mySource = new ResourceReferenceDt(); - } - return mySource; - } - - /** - * Sets the value(s) for source (Who initiated the order) - * - *

- * Definition: - * - *

- */ - public Order setSource(ResourceReferenceDt theValue) { - mySource = theValue; - return this; - } - - - /** - * Gets the value(s) for target (Who is intended to fulfill the order). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt getTarget() { - if (myTarget == null) { - myTarget = new ResourceReferenceDt(); - } - return myTarget; - } - - /** - * Sets the value(s) for target (Who is intended to fulfill the order) - * - *

- * Definition: - * - *

- */ - public Order setTarget(ResourceReferenceDt theValue) { - myTarget = theValue; - return this; - } - - - /** - * Gets the value(s) for reason[x] (Text - why the order was made). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public IDatatype getReason() { - return myReason; - } - - /** - * Sets the value(s) for reason[x] (Text - why the order was made) - * - *

- * Definition: - * - *

- */ - public Order setReason(IDatatype theValue) { - myReason = theValue; - return this; - } - - - /** - * Gets the value(s) for authority (If required by policy). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt getAuthority() { - if (myAuthority == null) { - myAuthority = new ResourceReferenceDt(); - } - return myAuthority; - } - - /** - * Sets the value(s) for authority (If required by policy) - * - *

- * Definition: - * - *

- */ - public Order setAuthority(ResourceReferenceDt theValue) { - myAuthority = theValue; - return this; - } - - - /** - * Gets the value(s) for when (When order should be fulfilled). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public When getWhen() { - if (myWhen == null) { - myWhen = new When(); - } - return myWhen; - } - - /** - * Sets the value(s) for when (When order should be fulfilled) - * - *

- * Definition: - * - *

- */ - public Order setWhen(When theValue) { - myWhen = theValue; - return this; - } - - - /** - * Gets the value(s) for detail (What action is being ordered). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getDetail() { - if (myDetail == null) { - myDetail = new java.util.ArrayList(); - } - return myDetail; - } - - /** - * Sets the value(s) for detail (What action is being ordered) - * - *

- * Definition: - * - *

- */ - public Order setDetail(java.util.List theValue) { - myDetail = theValue; - return this; - } - - /** - * Adds and returns a new value for detail (What action is being ordered) - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt addDetail() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getDetail().add(newType); - return newType; - } - - /** - * Block class for child element: Order.when (When order should be fulfilled) - * - *

- * Definition: - * - *

- */ - @Block() - public static class When extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="code", type=CodeableConceptDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Code specifies when request should be done. The code may simply be a priority code", - formalDefinition="" - ) - private CodeableConceptDt myCode; - - @Child(name="schedule", type=ScheduleDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="A formal schedule", - formalDefinition="" - ) - private ScheduleDt mySchedule; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCode, mySchedule); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCode, mySchedule); - } - - /** - * Gets the value(s) for code (Code specifies when request should be done. The code may simply be a priority code). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public CodeableConceptDt getCode() { - if (myCode == null) { - myCode = new CodeableConceptDt(); - } - return myCode; - } - - /** - * Sets the value(s) for code (Code specifies when request should be done. The code may simply be a priority code) - * - *

- * Definition: - * - *

- */ - public When setCode(CodeableConceptDt theValue) { - myCode = theValue; - return this; - } - - - /** - * Gets the value(s) for schedule (A formal schedule). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ScheduleDt getSchedule() { - if (mySchedule == null) { - mySchedule = new ScheduleDt(); - } - return mySchedule; - } - - /** - * Sets the value(s) for schedule (A formal schedule) - * - *

- * Definition: - * - *

- */ - public When setSchedule(ScheduleDt theValue) { - mySchedule = theValue; - return this; - } - - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/OrderResponse.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/OrderResponse.java deleted file mode 100644 index 0fa13d912d9..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/OrderResponse.java +++ /dev/null @@ -1,662 +0,0 @@ - - - - - - - - - - - - - - - - -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.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.Include; -import ca.uhn.fhir.model.api.TemporalPrecisionEnum; -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.Description; -import ca.uhn.fhir.model.api.annotation.ResourceDef; -import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; -import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.OrderOutcomeStatusEnum; -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.StringDt; -import ca.uhn.fhir.rest.gclient.DateClientParam; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR OrderResponse Resource - * (A response to an order) - * - *

- * Definition: - * A response to an order - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/OrderResponse - *

- * - */ -@ResourceDef(name="OrderResponse", profile="http://hl7.org/fhir/profiles/OrderResponse", id="orderresponse") -public class OrderResponse extends BaseResource implements IResource { - - /** - * Search parameter constant for request - *

- * Description:
- * Type: reference
- * Path: OrderResponse.request
- *

- */ - @SearchParamDefinition(name="request", path="OrderResponse.request", description="", type="reference" ) - public static final String SP_REQUEST = "request"; - - /** - * Fluent Client search parameter constant for request - *

- * Description:
- * Type: reference
- * Path: OrderResponse.request
- *

- */ - public static final ReferenceClientParam REQUEST = new ReferenceClientParam(SP_REQUEST); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "OrderResponse.request". - */ - public static final Include INCLUDE_REQUEST = new Include("OrderResponse.request"); - - /** - * Search parameter constant for date - *

- * Description:
- * Type: date
- * Path: OrderResponse.date
- *

- */ - @SearchParamDefinition(name="date", path="OrderResponse.date", description="", type="date" ) - public static final String SP_DATE = "date"; - - /** - * Fluent Client search parameter constant for date - *

- * Description:
- * Type: date
- * Path: OrderResponse.date
- *

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

- * Description:
- * Type: reference
- * Path: OrderResponse.who
- *

- */ - @SearchParamDefinition(name="who", path="OrderResponse.who", description="", type="reference" ) - public static final String SP_WHO = "who"; - - /** - * Fluent Client search parameter constant for who - *

- * Description:
- * Type: reference
- * Path: OrderResponse.who
- *

- */ - public static final ReferenceClientParam WHO = new ReferenceClientParam(SP_WHO); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "OrderResponse.who". - */ - public static final Include INCLUDE_WHO = new Include("OrderResponse.who"); - - /** - * Search parameter constant for code - *

- * Description:
- * Type: token
- * Path: OrderResponse.code
- *

- */ - @SearchParamDefinition(name="code", path="OrderResponse.code", description="", type="token" ) - public static final String SP_CODE = "code"; - - /** - * Fluent Client search parameter constant for code - *

- * Description:
- * Type: token
- * Path: OrderResponse.code
- *

- */ - public static final TokenClientParam CODE = new TokenClientParam(SP_CODE); - - /** - * Search parameter constant for fulfillment - *

- * Description:
- * Type: reference
- * Path: OrderResponse.fulfillment
- *

- */ - @SearchParamDefinition(name="fulfillment", path="OrderResponse.fulfillment", description="", type="reference" ) - public static final String SP_FULFILLMENT = "fulfillment"; - - /** - * Fluent Client search parameter constant for fulfillment - *

- * Description:
- * Type: reference
- * Path: OrderResponse.fulfillment
- *

- */ - public static final ReferenceClientParam FULFILLMENT = new ReferenceClientParam(SP_FULFILLMENT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "OrderResponse.fulfillment". - */ - public static final Include INCLUDE_FULFILLMENT = new Include("OrderResponse.fulfillment"); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Identifiers assigned to this order by the orderer or by the receiver", - formalDefinition="Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems" - ) - private java.util.List myIdentifier; - - @Child(name="request", order=1, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Order.class }) - @Description( - shortDefinition="The order that this is a response to", - formalDefinition="A reference to the order that this is in response to" - ) - private ResourceReferenceDt myRequest; - - @Child(name="date", type=DateTimeDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="When the response was made", - formalDefinition="The date and time at which this order response was made (created/posted)" - ) - private DateTimeDt myDate; - - @Child(name="who", order=3, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Organization.class, ca.uhn.fhir.model.dstu.resource.Device.class }) - @Description( - shortDefinition="Who made the response", - formalDefinition="The person, organization, or device credited with making the response" - ) - private ResourceReferenceDt myWho; - - @Child(name="authority", order=4, min=0, max=1, type={ - CodeableConceptDt.class, IResource.class }) - @Description( - shortDefinition="If required by policy", - formalDefinition="A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection" - ) - private IDatatype myAuthority; - - @Child(name="code", type=CodeDt.class, order=5, min=1, max=1) - @Description( - shortDefinition="pending | review | rejected | error | accepted | cancelled | replaced | aborted | complete", - formalDefinition="What this response says about the status of the original order" - ) - private BoundCodeDt myCode; - - @Child(name="description", type=StringDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="Additional description of the response", - formalDefinition="Additional description about the response - e.g. a text description provided by a human user when making decisions about the order" - ) - private StringDt myDescription; - - @Child(name="fulfillment", order=7, min=0, max=Child.MAX_UNLIMITED, type={ - IResource.class }) - @Description( - shortDefinition="Details of the outcome of performing the order", - formalDefinition="Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order" - ) - private java.util.List myFulfillment; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myRequest, myDate, myWho, myAuthority, myCode, myDescription, myFulfillment); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myRequest, myDate, myWho, myAuthority, myCode, myDescription, myFulfillment); - } - - /** - * Gets the value(s) for identifier (Identifiers assigned to this order by the orderer or by the receiver). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems - *

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Identifiers assigned to this order by the orderer or by the receiver) - * - *

- * Definition: - * Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems - *

- */ - public OrderResponse setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (Identifiers assigned to this order by the orderer or by the receiver) - * - *

- * Definition: - * Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems - *

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (Identifiers assigned to this order by the orderer or by the receiver), - * creating it if it does not already exist. - * - *

- * Definition: - * Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems - *

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (Identifiers assigned to this order by the orderer or by the receiver) - * - *

- * Definition: - * Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public OrderResponse addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (Identifiers assigned to this order by the orderer or by the receiver) - * - *

- * Definition: - * Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public OrderResponse addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for request (The order that this is a response to). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A reference to the order that this is in response to - *

- */ - public ResourceReferenceDt getRequest() { - if (myRequest == null) { - myRequest = new ResourceReferenceDt(); - } - return myRequest; - } - - /** - * Sets the value(s) for request (The order that this is a response to) - * - *

- * Definition: - * A reference to the order that this is in response to - *

- */ - public OrderResponse setRequest(ResourceReferenceDt theValue) { - myRequest = theValue; - return this; - } - - - /** - * Gets the value(s) for date (When the response was made). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The date and time at which this order response was made (created/posted) - *

- */ - public DateTimeDt getDate() { - if (myDate == null) { - myDate = new DateTimeDt(); - } - return myDate; - } - - /** - * Sets the value(s) for date (When the response was made) - * - *

- * Definition: - * The date and time at which this order response was made (created/posted) - *

- */ - public OrderResponse setDate(DateTimeDt theValue) { - myDate = theValue; - return this; - } - - /** - * Sets the value for date (When the response was made) - * - *

- * Definition: - * The date and time at which this order response was made (created/posted) - *

- */ - public OrderResponse setDateWithSecondsPrecision( Date theDate) { - myDate = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for date (When the response was made) - * - *

- * Definition: - * The date and time at which this order response was made (created/posted) - *

- */ - public OrderResponse setDate( Date theDate, TemporalPrecisionEnum thePrecision) { - myDate = new DateTimeDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for who (Who made the response). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The person, organization, or device credited with making the response - *

- */ - public ResourceReferenceDt getWho() { - if (myWho == null) { - myWho = new ResourceReferenceDt(); - } - return myWho; - } - - /** - * Sets the value(s) for who (Who made the response) - * - *

- * Definition: - * The person, organization, or device credited with making the response - *

- */ - public OrderResponse setWho(ResourceReferenceDt theValue) { - myWho = theValue; - return this; - } - - - /** - * Gets the value(s) for authority[x] (If required by policy). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection - *

- */ - public IDatatype getAuthority() { - return myAuthority; - } - - /** - * Sets the value(s) for authority[x] (If required by policy) - * - *

- * Definition: - * A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection - *

- */ - public OrderResponse setAuthority(IDatatype theValue) { - myAuthority = theValue; - return this; - } - - - /** - * Gets the value(s) for code (pending | review | rejected | error | accepted | cancelled | replaced | aborted | complete). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * What this response says about the status of the original order - *

- */ - public BoundCodeDt getCode() { - if (myCode == null) { - myCode = new BoundCodeDt(OrderOutcomeStatusEnum.VALUESET_BINDER); - } - return myCode; - } - - /** - * Sets the value(s) for code (pending | review | rejected | error | accepted | cancelled | replaced | aborted | complete) - * - *

- * Definition: - * What this response says about the status of the original order - *

- */ - public OrderResponse setCode(BoundCodeDt theValue) { - myCode = theValue; - return this; - } - - /** - * Sets the value(s) for code (pending | review | rejected | error | accepted | cancelled | replaced | aborted | complete) - * - *

- * Definition: - * What this response says about the status of the original order - *

- */ - public OrderResponse setCode(OrderOutcomeStatusEnum theValue) { - getCode().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for description (Additional description of the response). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Additional description about the response - e.g. a text description provided by a human user when making decisions about the order - *

- */ - public StringDt getDescription() { - if (myDescription == null) { - myDescription = new StringDt(); - } - return myDescription; - } - - /** - * Sets the value(s) for description (Additional description of the response) - * - *

- * Definition: - * Additional description about the response - e.g. a text description provided by a human user when making decisions about the order - *

- */ - public OrderResponse setDescription(StringDt theValue) { - myDescription = theValue; - return this; - } - - /** - * Sets the value for description (Additional description of the response) - * - *

- * Definition: - * Additional description about the response - e.g. a text description provided by a human user when making decisions about the order - *

- */ - public OrderResponse setDescription( String theString) { - myDescription = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for fulfillment (Details of the outcome of performing the order). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order - *

- */ - public java.util.List getFulfillment() { - if (myFulfillment == null) { - myFulfillment = new java.util.ArrayList(); - } - return myFulfillment; - } - - /** - * Sets the value(s) for fulfillment (Details of the outcome of performing the order) - * - *

- * Definition: - * Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order - *

- */ - public OrderResponse setFulfillment(java.util.List theValue) { - myFulfillment = theValue; - return this; - } - - /** - * Adds and returns a new value for fulfillment (Details of the outcome of performing the order) - * - *

- * Definition: - * Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order - *

- */ - public ResourceReferenceDt addFulfillment() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getFulfillment().add(newType); - return newType; - } - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Organization.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Organization.java deleted file mode 100644 index 0cb7102589a..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Organization.java +++ /dev/null @@ -1,1118 +0,0 @@ - - - - - - - - - - - - - - - - -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.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.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.AddressDt; -import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.ContactDt; -import ca.uhn.fhir.model.dstu.composite.HumanNameDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.OrganizationTypeEnum; -import ca.uhn.fhir.model.primitive.BooleanDt; -import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.StringClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR Organization Resource - * (A grouping of people or organizations with a common purpose) - * - *

- * Definition: - * A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Organization - *

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

- * Description: A portion of the organization's name
- * Type: string
- * Path: Organization.name
- *

- */ - @SearchParamDefinition(name="name", path="Organization.name", description="A portion of the organization's name", type="string" ) - public static final String SP_NAME = "name"; - - /** - * Fluent Client search parameter constant for name - *

- * Description: A portion of the organization's name
- * Type: string
- * Path: Organization.name
- *

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

- * Description: A portion of the organization's name using some kind of phonetic matching algorithm
- * Type: string
- * Path:
- *

- */ - @SearchParamDefinition(name="phonetic", path="", description="A portion of the organization's name using some kind of phonetic matching algorithm", type="string" ) - public static final String SP_PHONETIC = "phonetic"; - - /** - * Fluent Client search parameter constant for phonetic - *

- * Description: A portion of the organization's name using some kind of phonetic matching algorithm
- * Type: string
- * Path:
- *

- */ - public static final StringClientParam PHONETIC = new StringClientParam(SP_PHONETIC); - - /** - * Search parameter constant for type - *

- * Description: A code for the type of organization
- * Type: token
- * Path: Organization.type
- *

- */ - @SearchParamDefinition(name="type", path="Organization.type", description="A code for the type of organization", type="token" ) - public static final String SP_TYPE = "type"; - - /** - * Fluent Client search parameter constant for type - *

- * Description: A code for the type of organization
- * Type: token
- * Path: Organization.type
- *

- */ - public static final TokenClientParam TYPE = new TokenClientParam(SP_TYPE); - - /** - * Search parameter constant for identifier - *

- * Description: Any identifier for the organization (not the accreditation issuer's identifier)
- * Type: token
- * Path: Organization.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Organization.identifier", description="Any identifier for the organization (not the accreditation issuer's identifier)", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Any identifier for the organization (not the accreditation issuer's identifier)
- * Type: token
- * Path: Organization.identifier
- *

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

- * Description: Search all organizations that are part of the given organization
- * Type: reference
- * Path: Organization.partOf
- *

- */ - @SearchParamDefinition(name="partof", path="Organization.partOf", description="Search all organizations that are part of the given organization", type="reference" ) - public static final String SP_PARTOF = "partof"; - - /** - * Fluent Client search parameter constant for partof - *

- * Description: Search all organizations that are part of the given organization
- * Type: reference
- * Path: Organization.partOf
- *

- */ - public static final ReferenceClientParam PARTOF = new ReferenceClientParam(SP_PARTOF); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Organization.partOf". - */ - public static final Include INCLUDE_PARTOF = new Include("Organization.partOf"); - - /** - * Search parameter constant for active - *

- * Description: Whether the organization's record is active
- * Type: token
- * Path: Organization.active
- *

- */ - @SearchParamDefinition(name="active", path="Organization.active", description="Whether the organization's record is active", type="token" ) - public static final String SP_ACTIVE = "active"; - - /** - * Fluent Client search parameter constant for active - *

- * Description: Whether the organization's record is active
- * Type: token
- * Path: Organization.active
- *

- */ - public static final TokenClientParam ACTIVE = new TokenClientParam(SP_ACTIVE); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Identifies this organization across multiple systems", - formalDefinition="Identifier for the organization that is used to identify the organization across multiple disparate systems" - ) - private java.util.List myIdentifier; - - @Child(name="name", type=StringDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Name used for the organization", - formalDefinition="A name associated with the organization" - ) - private StringDt myName; - - @Child(name="type", type=CodeableConceptDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Kind of organization", - formalDefinition="The kind of organization that this is" - ) - private BoundCodeableConceptDt myType; - - @Child(name="telecom", type=ContactDt.class, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="A contact detail for the organization", - formalDefinition="A contact detail for the organization" - ) - private java.util.List myTelecom; - - @Child(name="address", type=AddressDt.class, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="An address for the organization", - formalDefinition="An address for the organization" - ) - private java.util.List myAddress; - - @Child(name="partOf", order=5, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Organization.class }) - @Description( - shortDefinition="The organization of which this organization forms a part", - formalDefinition="The organization of which this organization forms a part" - ) - private ResourceReferenceDt myPartOf; - - @Child(name="contact", order=6, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Contact for the organization for a certain purpose", - formalDefinition="" - ) - private java.util.List myContact; - - @Child(name="location", order=7, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Location.class }) - @Description( - shortDefinition="Location(s) the organization uses to provide services", - formalDefinition="Location(s) the organization uses to provide services" - ) - private java.util.List myLocation; - - @Child(name="active", type=BooleanDt.class, order=8, min=0, max=1) - @Description( - shortDefinition="Whether the organization's record is still in active use", - formalDefinition="Whether the organization's record is still in active use" - ) - private BooleanDt myActive; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myName, myType, myTelecom, myAddress, myPartOf, myContact, myLocation, myActive); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myName, myType, myTelecom, myAddress, myPartOf, myContact, myLocation, myActive); - } - - /** - * Gets the value(s) for identifier (Identifies this organization across multiple systems). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Identifies this organization across multiple systems) - * - *

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

- */ - public Organization setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (Identifies this organization across multiple systems) - * - *

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

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (Identifies this organization across multiple systems), - * creating it if it does not already exist. - * - *

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

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (Identifies this organization across multiple systems) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Organization addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (Identifies this organization across multiple systems) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Organization addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for name (Name used for the organization). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A name associated with the organization - *

- */ - public StringDt getName() { - if (myName == null) { - myName = new StringDt(); - } - return myName; - } - - /** - * Sets the value(s) for name (Name used for the organization) - * - *

- * Definition: - * A name associated with the organization - *

- */ - public Organization setName(StringDt theValue) { - myName = theValue; - return this; - } - - /** - * Sets the value for name (Name used for the organization) - * - *

- * Definition: - * A name associated with the organization - *

- */ - public Organization setName( String theString) { - myName = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for type (Kind of organization). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The kind of organization that this is - *

- */ - public BoundCodeableConceptDt getType() { - if (myType == null) { - myType = new BoundCodeableConceptDt(OrganizationTypeEnum.VALUESET_BINDER); - } - return myType; - } - - /** - * Sets the value(s) for type (Kind of organization) - * - *

- * Definition: - * The kind of organization that this is - *

- */ - public Organization setType(BoundCodeableConceptDt theValue) { - myType = theValue; - return this; - } - - /** - * Sets the value(s) for type (Kind of organization) - * - *

- * Definition: - * The kind of organization that this is - *

- */ - public Organization setType(OrganizationTypeEnum theValue) { - getType().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for telecom (A contact detail for the organization). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getTelecom() { - if (myTelecom == null) { - myTelecom = new java.util.ArrayList(); - } - return myTelecom; - } - - /** - * Sets the value(s) for telecom (A contact detail for the organization) - * - *

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

- */ - public Organization setTelecom(java.util.List theValue) { - myTelecom = theValue; - return this; - } - - /** - * Adds and returns a new value for telecom (A contact detail for the organization) - * - *

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

- */ - public ContactDt addTelecom() { - ContactDt newType = new ContactDt(); - getTelecom().add(newType); - return newType; - } - - /** - * Gets the first repetition for telecom (A contact detail for the organization), - * creating it if it does not already exist. - * - *

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

- */ - public ContactDt getTelecomFirstRep() { - if (getTelecom().isEmpty()) { - return addTelecom(); - } - return getTelecom().get(0); - } - /** - * Adds a new value for telecom (A contact detail for the organization) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Organization 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 (A contact detail for the organization) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Organization addTelecom( String theValue) { - if (myTelecom == null) { - myTelecom = new java.util.ArrayList(); - } - myTelecom.add(new ContactDt(theValue)); - return this; - } - - - /** - * Gets the value(s) for address (An address for the organization). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getAddress() { - if (myAddress == null) { - myAddress = new java.util.ArrayList(); - } - return myAddress; - } - - /** - * Sets the value(s) for address (An address for the organization) - * - *

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

- */ - public Organization setAddress(java.util.List theValue) { - myAddress = theValue; - return this; - } - - /** - * Adds and returns a new value for address (An address for the organization) - * - *

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

- */ - public AddressDt addAddress() { - AddressDt newType = new AddressDt(); - getAddress().add(newType); - return newType; - } - - /** - * Gets the first repetition for address (An address for the organization), - * creating it if it does not already exist. - * - *

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

- */ - public AddressDt getAddressFirstRep() { - if (getAddress().isEmpty()) { - return addAddress(); - } - return getAddress().get(0); - } - - /** - * Gets the value(s) for partOf (The organization of which this organization forms a part). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The organization of which this organization forms a part - *

- */ - public ResourceReferenceDt getPartOf() { - if (myPartOf == null) { - myPartOf = new ResourceReferenceDt(); - } - return myPartOf; - } - - /** - * Sets the value(s) for partOf (The organization of which this organization forms a part) - * - *

- * Definition: - * The organization of which this organization forms a part - *

- */ - public Organization setPartOf(ResourceReferenceDt theValue) { - myPartOf = theValue; - return this; - } - - - /** - * Gets the value(s) for contact (Contact for the organization for a certain purpose). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getContact() { - if (myContact == null) { - myContact = new java.util.ArrayList(); - } - return myContact; - } - - /** - * Sets the value(s) for contact (Contact for the organization for a certain purpose) - * - *

- * Definition: - * - *

- */ - public Organization setContact(java.util.List theValue) { - myContact = theValue; - return this; - } - - /** - * Adds and returns a new value for contact (Contact for the organization for a certain purpose) - * - *

- * Definition: - * - *

- */ - public Contact addContact() { - Contact newType = new Contact(); - getContact().add(newType); - return newType; - } - - /** - * Gets the first repetition for contact (Contact for the organization for a certain purpose), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public Contact getContactFirstRep() { - if (getContact().isEmpty()) { - return addContact(); - } - return getContact().get(0); - } - - /** - * Gets the value(s) for location (Location(s) the organization uses to provide services). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getLocation() { - if (myLocation == null) { - myLocation = new java.util.ArrayList(); - } - return myLocation; - } - - /** - * Sets the value(s) for location (Location(s) the organization uses to provide services) - * - *

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

- */ - public Organization setLocation(java.util.List theValue) { - myLocation = theValue; - return this; - } - - /** - * Adds and returns a new value for location (Location(s) the organization uses to provide services) - * - *

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

- */ - public ResourceReferenceDt addLocation() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getLocation().add(newType); - return newType; - } - - /** - * Gets the value(s) for active (Whether the organization's record is still in active use). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Whether the organization's record is still in active use - *

- */ - public BooleanDt getActive() { - if (myActive == null) { - myActive = new BooleanDt(); - } - return myActive; - } - - /** - * Sets the value(s) for active (Whether the organization's record is still in active use) - * - *

- * Definition: - * Whether the organization's record is still in active use - *

- */ - public Organization setActive(BooleanDt theValue) { - myActive = theValue; - return this; - } - - /** - * Sets the value for active (Whether the organization's record is still in active use) - * - *

- * Definition: - * Whether the organization's record is still in active use - *

- */ - public Organization setActive( boolean theBoolean) { - myActive = new BooleanDt(theBoolean); - return this; - } - - - /** - * Block class for child element: Organization.contact (Contact for the organization for a certain purpose) - * - *

- * Definition: - * - *

- */ - @Block() - public static class Contact extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="purpose", type=CodeableConceptDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="The type of contact", - formalDefinition="Indicates a purpose for which the contact can be reached" - ) - private CodeableConceptDt myPurpose; - - @Child(name="name", type=HumanNameDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="A name associated with the contact", - formalDefinition="A name associated with the contact" - ) - private HumanNameDt myName; - - @Child(name="telecom", type=ContactDt.class, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Contact details (telephone, email, etc) for a contact", - formalDefinition="A contact detail (e.g. a telephone number or an email address) by which the party may be contacted." - ) - private java.util.List myTelecom; - - @Child(name="address", type=AddressDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Visiting or postal addresses for the contact", - formalDefinition="Visiting or postal addresses for the contact" - ) - private AddressDt myAddress; - - @Child(name="gender", type=CodeableConceptDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="Gender for administrative purposes", - formalDefinition="Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes." - ) - private BoundCodeableConceptDt myGender; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myPurpose, myName, myTelecom, myAddress, myGender); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myPurpose, myName, myTelecom, myAddress, myGender); - } - - /** - * Gets the value(s) for purpose (The type of contact). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates a purpose for which the contact can be reached - *

- */ - public CodeableConceptDt getPurpose() { - if (myPurpose == null) { - myPurpose = new CodeableConceptDt(); - } - return myPurpose; - } - - /** - * Sets the value(s) for purpose (The type of contact) - * - *

- * Definition: - * Indicates a purpose for which the contact can be reached - *

- */ - public Contact setPurpose(CodeableConceptDt theValue) { - myPurpose = theValue; - return this; - } - - - /** - * Gets the value(s) for name (A name associated with the contact). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A name associated with the contact - *

- */ - public HumanNameDt getName() { - if (myName == null) { - myName = new HumanNameDt(); - } - return myName; - } - - /** - * Sets the value(s) for name (A name associated with the contact) - * - *

- * Definition: - * A name associated with the contact - *

- */ - public Contact setName(HumanNameDt theValue) { - myName = theValue; - return this; - } - - - /** - * Gets the value(s) for telecom (Contact details (telephone, email, etc) for a contact). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getTelecom() { - if (myTelecom == null) { - myTelecom = new java.util.ArrayList(); - } - return myTelecom; - } - - /** - * Sets the value(s) for telecom (Contact details (telephone, email, etc) for a contact) - * - *

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

- */ - public Contact setTelecom(java.util.List theValue) { - myTelecom = theValue; - return this; - } - - /** - * Adds and returns a new value for telecom (Contact details (telephone, email, etc) for a contact) - * - *

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

- */ - public ContactDt addTelecom() { - ContactDt newType = new ContactDt(); - getTelecom().add(newType); - return newType; - } - - /** - * Gets the first repetition for telecom (Contact details (telephone, email, etc) for a contact), - * creating it if it does not already exist. - * - *

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

- */ - public ContactDt getTelecomFirstRep() { - if (getTelecom().isEmpty()) { - return addTelecom(); - } - return getTelecom().get(0); - } - /** - * Adds a new value for telecom (Contact details (telephone, email, etc) for a contact) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Contact 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 details (telephone, email, etc) for a contact) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Contact addTelecom( String theValue) { - if (myTelecom == null) { - myTelecom = new java.util.ArrayList(); - } - myTelecom.add(new ContactDt(theValue)); - return this; - } - - - /** - * Gets the value(s) for address (Visiting or postal addresses for the contact). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Visiting or postal addresses for the contact - *

- */ - public AddressDt getAddress() { - if (myAddress == null) { - myAddress = new AddressDt(); - } - return myAddress; - } - - /** - * Sets the value(s) for address (Visiting or postal addresses for the contact) - * - *

- * Definition: - * Visiting or postal addresses for the contact - *

- */ - public Contact setAddress(AddressDt theValue) { - myAddress = theValue; - return this; - } - - - /** - * Gets the value(s) for gender (Gender for administrative purposes). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - *

- */ - public BoundCodeableConceptDt getGender() { - if (myGender == null) { - myGender = new BoundCodeableConceptDt(AdministrativeGenderCodesEnum.VALUESET_BINDER); - } - return myGender; - } - - /** - * Sets the value(s) for gender (Gender for administrative purposes) - * - *

- * Definition: - * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - *

- */ - public Contact setGender(BoundCodeableConceptDt theValue) { - myGender = theValue; - return this; - } - - /** - * Sets the value(s) for gender (Gender for administrative purposes) - * - *

- * Definition: - * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - *

- */ - public Contact setGender(AdministrativeGenderCodesEnum theValue) { - getGender().setValueAsEnum(theValue); - return this; - } - - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Other.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Other.java deleted file mode 100644 index d52f6372067..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Other.java +++ /dev/null @@ -1,451 +0,0 @@ - - - - - - - - - - - - - - - - -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.BaseResource; -import ca.uhn.fhir.model.api.IElement; -import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.api.Include; -import ca.uhn.fhir.model.api.TemporalPrecisionEnum; -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.Description; -import ca.uhn.fhir.model.api.annotation.ResourceDef; -import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; -import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.primitive.DateDt; -import ca.uhn.fhir.rest.gclient.DateClientParam; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR Other Resource - * (Resource for non-supported content) - * - *

- * Definition: - * Other is a conformant for handling resource concepts not yet defined for FHIR or outside HL7's scope of interest - *

- * - *

- * Requirements: - * Need some way to safely (without breaking interoperability) allow implementers to exchange content not supported by the initial set of declared resources. - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Other - *

- * - */ -@ResourceDef(name="Other", profile="http://hl7.org/fhir/profiles/Other", id="other") -public class Other extends BaseResource implements IResource { - - /** - * Search parameter constant for subject - *

- * Description:
- * Type: reference
- * Path: Other.subject
- *

- */ - @SearchParamDefinition(name="subject", path="Other.subject", description="", type="reference" ) - public static final String SP_SUBJECT = "subject"; - - /** - * Fluent Client search parameter constant for subject - *

- * Description:
- * Type: reference
- * Path: Other.subject
- *

- */ - public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Other.subject". - */ - public static final Include INCLUDE_SUBJECT = new Include("Other.subject"); - - /** - * Search parameter constant for created - *

- * Description:
- * Type: date
- * Path: Other.created
- *

- */ - @SearchParamDefinition(name="created", path="Other.created", description="", type="date" ) - public static final String SP_CREATED = "created"; - - /** - * Fluent Client search parameter constant for created - *

- * Description:
- * Type: date
- * Path: Other.created
- *

- */ - public static final DateClientParam CREATED = new DateClientParam(SP_CREATED); - - /** - * Search parameter constant for code - *

- * Description:
- * Type: token
- * Path: Other.code
- *

- */ - @SearchParamDefinition(name="code", path="Other.code", description="", type="token" ) - public static final String SP_CODE = "code"; - - /** - * Fluent Client search parameter constant for code - *

- * Description:
- * Type: token
- * Path: Other.code
- *

- */ - public static final TokenClientParam CODE = new TokenClientParam(SP_CODE); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Business identifier", - formalDefinition="Identifier assigned to the resource for business purposes, outside the context of FHIR" - ) - private java.util.List myIdentifier; - - @Child(name="code", type=CodeableConceptDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="Kind of Resource", - formalDefinition="Identifies the 'type' of resource - equivalent to the resource name for other resources." - ) - private CodeableConceptDt myCode; - - @Child(name="subject", order=2, min=0, max=1, type={ - IResource.class }) - @Description( - shortDefinition="Identifies the", - formalDefinition="Identifies the patient, practitioner, device or any other resource that is the \"focus\" of this resoruce." - ) - private ResourceReferenceDt mySubject; - - @Child(name="author", order=3, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.RelatedPerson.class }) - @Description( - shortDefinition="Who created", - formalDefinition="Indicates who was responsible for creating the resource instance" - ) - private ResourceReferenceDt myAuthor; - - @Child(name="created", type=DateDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="When created", - formalDefinition="Identifies when the resource was first created" - ) - private DateDt myCreated; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myCode, mySubject, myAuthor, myCreated); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myCode, mySubject, myAuthor, myCreated); - } - - /** - * Gets the value(s) for identifier (Business identifier). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifier assigned to the resource for business purposes, outside the context of FHIR - *

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Business identifier) - * - *

- * Definition: - * Identifier assigned to the resource for business purposes, outside the context of FHIR - *

- */ - public Other setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (Business identifier) - * - *

- * Definition: - * Identifier assigned to the resource for business purposes, outside the context of FHIR - *

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (Business identifier), - * creating it if it does not already exist. - * - *

- * Definition: - * Identifier assigned to the resource for business purposes, outside the context of FHIR - *

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (Business identifier) - * - *

- * Definition: - * Identifier assigned to the resource for business purposes, outside the context of FHIR - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Other addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (Business identifier) - * - *

- * Definition: - * Identifier assigned to the resource for business purposes, outside the context of FHIR - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Other addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for code (Kind of Resource). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the 'type' of resource - equivalent to the resource name for other resources. - *

- */ - public CodeableConceptDt getCode() { - if (myCode == null) { - myCode = new CodeableConceptDt(); - } - return myCode; - } - - /** - * Sets the value(s) for code (Kind of Resource) - * - *

- * Definition: - * Identifies the 'type' of resource - equivalent to the resource name for other resources. - *

- */ - public Other setCode(CodeableConceptDt theValue) { - myCode = theValue; - return this; - } - - - /** - * Gets the value(s) for subject (Identifies the). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the patient, practitioner, device or any other resource that is the \"focus\" of this resoruce. - *

- */ - public ResourceReferenceDt getSubject() { - if (mySubject == null) { - mySubject = new ResourceReferenceDt(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (Identifies the) - * - *

- * Definition: - * Identifies the patient, practitioner, device or any other resource that is the \"focus\" of this resoruce. - *

- */ - public Other setSubject(ResourceReferenceDt theValue) { - mySubject = theValue; - return this; - } - - - /** - * Gets the value(s) for author (Who created). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates who was responsible for creating the resource instance - *

- */ - public ResourceReferenceDt getAuthor() { - if (myAuthor == null) { - myAuthor = new ResourceReferenceDt(); - } - return myAuthor; - } - - /** - * Sets the value(s) for author (Who created) - * - *

- * Definition: - * Indicates who was responsible for creating the resource instance - *

- */ - public Other setAuthor(ResourceReferenceDt theValue) { - myAuthor = theValue; - return this; - } - - - /** - * Gets the value(s) for created (When created). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies when the resource was first created - *

- */ - public DateDt getCreated() { - if (myCreated == null) { - myCreated = new DateDt(); - } - return myCreated; - } - - /** - * Sets the value(s) for created (When created) - * - *

- * Definition: - * Identifies when the resource was first created - *

- */ - public Other setCreated(DateDt theValue) { - myCreated = theValue; - return this; - } - - /** - * Sets the value for created (When created) - * - *

- * Definition: - * Identifies when the resource was first created - *

- */ - public Other setCreatedWithDayPrecision( Date theDate) { - myCreated = new DateDt(theDate); - return this; - } - - /** - * Sets the value for created (When created) - * - *

- * Definition: - * Identifies when the resource was first created - *

- */ - public Other setCreated( Date theDate, TemporalPrecisionEnum thePrecision) { - myCreated = new DateDt(theDate, thePrecision); - return this; - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Patient.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Patient.java deleted file mode 100644 index 749fd1dcf40..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Patient.java +++ /dev/null @@ -1,2102 +0,0 @@ - - - - - - - - - - - - - - - - -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.AddressDt; -import ca.uhn.fhir.model.dstu.composite.AttachmentDt; -import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.ContactDt; -import ca.uhn.fhir.model.dstu.composite.HumanNameDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.AnimalSpeciesEnum; -import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.LinkTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.MaritalStatusCodesEnum; -import ca.uhn.fhir.model.primitive.BooleanDt; -import ca.uhn.fhir.model.primitive.BoundCodeDt; -import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; -import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.model.primitive.IntegerDt; -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 Patient Resource - * (Information about a person or animal receiving health care services) - * - *

- * Definition: - * Demographics and other administrative information about a person or animal receiving care or other health-related services - *

- * - *

- * Requirements: - * Tracking patient is the center of the healthcare process - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Patient - *

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

- * Description: A patient identifier
- * Type: token
- * Path: Patient.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Patient.identifier", description="A patient identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - - /** - * Fluent Client search parameter constant for identifier - *

- * Description: A patient identifier
- * Type: token
- * Path: Patient.identifier
- *

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

- * Description: A portion of either family or given name of the patient
- * Type: string
- * Path: Patient.name
- *

- */ - @SearchParamDefinition(name="name", path="Patient.name", description="A portion of either family or given name of the patient", type="string" ) - public static final String SP_NAME = "name"; - - /** - * Fluent Client search parameter constant for name - *

- * Description: A portion of either family or given name of the patient
- * Type: string
- * Path: Patient.name
- *

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

- * Description: A portion of the family name of the patient
- * Type: string
- * Path: Patient.name.family
- *

- */ - @SearchParamDefinition(name="family", path="Patient.name.family", description="A portion of the family name of the patient", type="string" ) - public static final String SP_FAMILY = "family"; - - /** - * Fluent Client search parameter constant for family - *

- * Description: A portion of the family name of the patient
- * Type: string
- * Path: Patient.name.family
- *

- */ - public static final StringClientParam FAMILY = new StringClientParam(SP_FAMILY); - - /** - * Search parameter constant for given - *

- * Description: A portion of the given name of the patient
- * Type: string
- * Path: Patient.name.given
- *

- */ - @SearchParamDefinition(name="given", path="Patient.name.given", description="A portion of the given name of the patient", type="string" ) - public static final String SP_GIVEN = "given"; - - /** - * Fluent Client search parameter constant for given - *

- * Description: A portion of the given name of the patient
- * Type: string
- * Path: Patient.name.given
- *

- */ - public static final StringClientParam GIVEN = new StringClientParam(SP_GIVEN); - - /** - * Search parameter constant for phonetic - *

- * Description: A portion of either family or given name using some kind of phonetic matching algorithm
- * Type: string
- * Path:
- *

- */ - @SearchParamDefinition(name="phonetic", path="", description="A portion of either family or given name using some kind of phonetic matching algorithm", type="string" ) - public static final String SP_PHONETIC = "phonetic"; - - /** - * Fluent Client search parameter constant for phonetic - *

- * Description: A portion of either family or given name using some kind of phonetic matching algorithm
- * Type: string
- * Path:
- *

- */ - public static final StringClientParam PHONETIC = new StringClientParam(SP_PHONETIC); - - /** - * Search parameter constant for telecom - *

- * Description: The value in any kind of telecom details of the patient
- * Type: string
- * Path: Patient.telecom
- *

- */ - @SearchParamDefinition(name="telecom", path="Patient.telecom", description="The value in any kind of telecom details of the patient", type="string" ) - public static final String SP_TELECOM = "telecom"; - - /** - * Fluent Client search parameter constant for telecom - *

- * Description: The value in any kind of telecom details of the patient
- * Type: string
- * Path: Patient.telecom
- *

- */ - public static final StringClientParam TELECOM = new StringClientParam(SP_TELECOM); - - /** - * Search parameter constant for address - *

- * Description: An address in any kind of address/part of the patient
- * Type: string
- * Path: Patient.address
- *

- */ - @SearchParamDefinition(name="address", path="Patient.address", description="An address in any kind of address/part of the patient", type="string" ) - public static final String SP_ADDRESS = "address"; - - /** - * Fluent Client search parameter constant for address - *

- * Description: An address in any kind of address/part of the patient
- * Type: string
- * Path: Patient.address
- *

- */ - public static final StringClientParam ADDRESS = new StringClientParam(SP_ADDRESS); - - /** - * Search parameter constant for gender - *

- * Description: Gender of the patient
- * Type: token
- * Path: Patient.gender
- *

- */ - @SearchParamDefinition(name="gender", path="Patient.gender", description="Gender of the patient", type="token" ) - public static final String SP_GENDER = "gender"; - - /** - * Fluent Client search parameter constant for gender - *

- * Description: Gender of the patient
- * Type: token
- * Path: Patient.gender
- *

- */ - public static final TokenClientParam GENDER = new TokenClientParam(SP_GENDER); - - /** - * Search parameter constant for language - *

- * Description: Language code (irrespective of use value)
- * Type: token
- * Path: Patient.communication
- *

- */ - @SearchParamDefinition(name="language", path="Patient.communication", description="Language code (irrespective of use value)", type="token" ) - public static final String SP_LANGUAGE = "language"; - - /** - * Fluent Client search parameter constant for language - *

- * Description: Language code (irrespective of use value)
- * Type: token
- * Path: Patient.communication
- *

- */ - public static final TokenClientParam LANGUAGE = new TokenClientParam(SP_LANGUAGE); - - /** - * Search parameter constant for birthdate - *

- * Description: The patient's date of birth
- * Type: date
- * Path: Patient.birthDate
- *

- */ - @SearchParamDefinition(name="birthdate", path="Patient.birthDate", description="The patient's date of birth", type="date" ) - public static final String SP_BIRTHDATE = "birthdate"; - - /** - * Fluent Client search parameter constant for birthdate - *

- * Description: The patient's date of birth
- * Type: date
- * Path: Patient.birthDate
- *

- */ - public static final DateClientParam BIRTHDATE = new DateClientParam(SP_BIRTHDATE); - - /** - * Search parameter constant for provider - *

- * Description: The organization at which this person is a patient
- * Type: reference
- * Path: Patient.managingOrganization
- *

- */ - @SearchParamDefinition(name="provider", path="Patient.managingOrganization", description="The organization at which this person is a patient", type="reference" ) - public static final String SP_PROVIDER = "provider"; - - /** - * Fluent Client search parameter constant for provider - *

- * Description: The organization at which this person is a patient
- * Type: reference
- * Path: Patient.managingOrganization
- *

- */ - public static final ReferenceClientParam PROVIDER = new ReferenceClientParam(SP_PROVIDER); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Patient.managingOrganization". - */ - public static final Include INCLUDE_MANAGINGORGANIZATION = new Include("Patient.managingOrganization"); - - /** - * Search parameter constant for active - *

- * Description: Whether the patient record is active
- * Type: token
- * Path: Patient.active
- *

- */ - @SearchParamDefinition(name="active", path="Patient.active", description="Whether the patient record is active", type="token" ) - public static final String SP_ACTIVE = "active"; - - /** - * Fluent Client search parameter constant for active - *

- * Description: Whether the patient record is active
- * Type: token
- * Path: Patient.active
- *

- */ - public static final TokenClientParam ACTIVE = new TokenClientParam(SP_ACTIVE); - - /** - * Search parameter constant for animal-species - *

- * Description: The species for animal patients
- * Type: token
- * Path: Patient.animal.species
- *

- */ - @SearchParamDefinition(name="animal-species", path="Patient.animal.species", description="The species for animal patients", type="token" ) - public static final String SP_ANIMAL_SPECIES = "animal-species"; - - /** - * Fluent Client search parameter constant for animal-species - *

- * Description: The species for animal patients
- * Type: token
- * Path: Patient.animal.species
- *

- */ - public static final TokenClientParam ANIMAL_SPECIES = new TokenClientParam(SP_ANIMAL_SPECIES); - - /** - * Search parameter constant for animal-breed - *

- * Description: The breed for animal patients
- * Type: token
- * Path: Patient.animal.breed
- *

- */ - @SearchParamDefinition(name="animal-breed", path="Patient.animal.breed", description="The breed for animal patients", type="token" ) - public static final String SP_ANIMAL_BREED = "animal-breed"; - - /** - * Fluent Client search parameter constant for animal-breed - *

- * Description: The breed for animal patients
- * Type: token
- * Path: Patient.animal.breed
- *

- */ - public static final TokenClientParam ANIMAL_BREED = new TokenClientParam(SP_ANIMAL_BREED); - - /** - * Search parameter constant for link - *

- * Description: All patients linked to the given patient
- * Type: reference
- * Path: Patient.link.other
- *

- */ - @SearchParamDefinition(name="link", path="Patient.link.other", description="All patients linked to the given patient", type="reference" ) - public static final String SP_LINK = "link"; - - /** - * Fluent Client search parameter constant for link - *

- * Description: All patients linked to the given patient
- * Type: reference
- * Path: Patient.link.other
- *

- */ - public static final ReferenceClientParam LINK = new ReferenceClientParam(SP_LINK); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Patient.link.other". - */ - public static final Include INCLUDE_LINK_OTHER = new Include("Patient.link.other"); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="An identifier for the person as this patient", - formalDefinition="An identifier that applies to this person as a patient" - ) - private java.util.List myIdentifier; - - @Child(name="name", type=HumanNameDt.class, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="A name associated with the patient", - formalDefinition="A name associated with the individual." - ) - private java.util.List myName; - - @Child(name="telecom", type=ContactDt.class, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="A contact detail for the individual", - formalDefinition="A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted." - ) - private java.util.List myTelecom; - - @Child(name="gender", type=CodeableConceptDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Gender for administrative purposes", - formalDefinition="Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes." - ) - private BoundCodeableConceptDt myGender; - - @Child(name="birthDate", type=DateTimeDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="The date and time of birth for the individual", - formalDefinition="The date and time of birth for the individual" - ) - private DateTimeDt myBirthDate; - - @Child(name="deceased", order=5, min=0, max=1, type={ - BooleanDt.class, DateTimeDt.class }) - @Description( - shortDefinition="Indicates if the individual is deceased or not", - formalDefinition="Indicates if the individual is deceased or not" - ) - private IDatatype myDeceased; - - @Child(name="address", type=AddressDt.class, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Addresses for the individual", - formalDefinition="Addresses for the individual" - ) - private java.util.List myAddress; - - @Child(name="maritalStatus", type=CodeableConceptDt.class, order=7, min=0, max=1) - @Description( - shortDefinition="Marital (civil) status of a person", - formalDefinition="This field contains a patient's most recent marital (civil) status." - ) - private BoundCodeableConceptDt myMaritalStatus; - - @Child(name="multipleBirth", order=8, min=0, max=1, type={ - BooleanDt.class, IntegerDt.class }) - @Description( - shortDefinition="Whether patient is part of a multiple birth", - formalDefinition="Indicates whether the patient is part of a multiple or indicates the actual birth order." - ) - private IDatatype myMultipleBirth; - - @Child(name="photo", type=AttachmentDt.class, order=9, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Image of the person", - formalDefinition="Image of the person" - ) - private java.util.List myPhoto; - - @Child(name="contact", order=10, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="A contact party (e.g. guardian, partner, friend) for the patient", - formalDefinition="A contact party (e.g. guardian, partner, friend) for the patient" - ) - private java.util.List myContact; - - @Child(name="animal", order=11, min=0, max=1) - @Description( - shortDefinition="If this patient is an animal (non-human)", - formalDefinition="This element has a value if the patient is an animal" - ) - private Animal myAnimal; - - @Child(name="communication", type=CodeableConceptDt.class, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Languages which may be used to communicate with the patient about his or her health", - formalDefinition="Languages which may be used to communicate with the patient about his or her health" - ) - private java.util.List myCommunication; - - @Child(name="careProvider", order=13, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Organization.class, ca.uhn.fhir.model.dstu.resource.Practitioner.class }) - @Description( - shortDefinition="Patient's nominated care provider", - formalDefinition="Patient's nominated care provider" - ) - private java.util.List myCareProvider; - - @Child(name="managingOrganization", order=14, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Organization.class }) - @Description( - shortDefinition="Organization that is the custodian of the patient record", - formalDefinition="Organization that is the custodian of the patient record" - ) - private ResourceReferenceDt myManagingOrganization; - - @Child(name="link", order=15, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Link to another patient resource that concerns the same actual person", - formalDefinition="Link to another patient resource that concerns the same actual person" - ) - private java.util.List myLink; - - @Child(name="active", type=BooleanDt.class, order=16, min=0, max=1) - @Description( - shortDefinition="Whether this patient's record is in active use", - formalDefinition="Whether this patient record is in active use" - ) - private BooleanDt myActive; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myName, myTelecom, myGender, myBirthDate, myDeceased, myAddress, myMaritalStatus, myMultipleBirth, myPhoto, myContact, myAnimal, myCommunication, myCareProvider, myManagingOrganization, myLink, myActive); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myName, myTelecom, myGender, myBirthDate, myDeceased, myAddress, myMaritalStatus, myMultipleBirth, myPhoto, myContact, myAnimal, myCommunication, myCareProvider, myManagingOrganization, myLink, myActive); - } - - /** - * Gets the value(s) for identifier (An identifier for the person as this patient). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (An identifier for the person as this patient) - * - *

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

- */ - public Patient setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (An identifier for the person as this patient) - * - *

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

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (An identifier for the person as this patient), - * creating it if it does not already exist. - * - *

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

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (An identifier for the person as this patient) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Patient addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (An identifier for the person as this patient) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Patient addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for name (A name associated with the patient). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getName() { - if (myName == null) { - myName = new java.util.ArrayList(); - } - return myName; - } - - /** - * Sets the value(s) for name (A name associated with the patient) - * - *

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

- */ - public Patient setName(java.util.List theValue) { - myName = theValue; - return this; - } - - /** - * Adds and returns a new value for name (A name associated with the patient) - * - *

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

- */ - public HumanNameDt addName() { - HumanNameDt newType = new HumanNameDt(); - getName().add(newType); - return newType; - } - - /** - * Gets the first repetition for name (A name associated with the patient), - * creating it if it does not already exist. - * - *

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

- */ - public HumanNameDt getNameFirstRep() { - if (getName().isEmpty()) { - return addName(); - } - return getName().get(0); - } - - /** - * Gets the value(s) for telecom (A contact detail for the individual). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getTelecom() { - if (myTelecom == null) { - myTelecom = new java.util.ArrayList(); - } - return myTelecom; - } - - /** - * Sets the value(s) for telecom (A contact detail for the individual) - * - *

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

- */ - public Patient setTelecom(java.util.List theValue) { - myTelecom = theValue; - return this; - } - - /** - * Adds and returns a new value for telecom (A contact detail for the individual) - * - *

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

- */ - public ContactDt addTelecom() { - ContactDt newType = new ContactDt(); - getTelecom().add(newType); - return newType; - } - - /** - * Gets the first repetition for telecom (A contact detail for the individual), - * creating it if it does not already exist. - * - *

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

- */ - public ContactDt getTelecomFirstRep() { - if (getTelecom().isEmpty()) { - return addTelecom(); - } - return getTelecom().get(0); - } - /** - * Adds a new value for telecom (A contact detail for the individual) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Patient 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 (A contact detail for the individual) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Patient addTelecom( String theValue) { - if (myTelecom == null) { - myTelecom = new java.util.ArrayList(); - } - myTelecom.add(new ContactDt(theValue)); - return this; - } - - - /** - * Gets the value(s) for gender (Gender for administrative purposes). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes. - *

- */ - public BoundCodeableConceptDt getGender() { - if (myGender == null) { - myGender = new BoundCodeableConceptDt(AdministrativeGenderCodesEnum.VALUESET_BINDER); - } - return myGender; - } - - /** - * Sets the value(s) for gender (Gender for administrative purposes) - * - *

- * Definition: - * Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes. - *

- */ - public Patient setGender(BoundCodeableConceptDt theValue) { - myGender = theValue; - return this; - } - - /** - * Sets the value(s) for gender (Gender for administrative purposes) - * - *

- * Definition: - * Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes. - *

- */ - public Patient setGender(AdministrativeGenderCodesEnum theValue) { - getGender().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for birthDate (The date and time of birth for the individual). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The date and time of birth for the individual - *

- */ - public DateTimeDt getBirthDate() { - if (myBirthDate == null) { - myBirthDate = new DateTimeDt(); - } - return myBirthDate; - } - - /** - * Sets the value(s) for birthDate (The date and time of birth for the individual) - * - *

- * Definition: - * The date and time of birth for the individual - *

- */ - public Patient setBirthDate(DateTimeDt theValue) { - myBirthDate = theValue; - return this; - } - - /** - * Sets the value for birthDate (The date and time of birth for the individual) - * - *

- * Definition: - * The date and time of birth for the individual - *

- */ - public Patient setBirthDateWithSecondsPrecision( Date theDate) { - myBirthDate = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for birthDate (The date and time of birth for the individual) - * - *

- * Definition: - * The date and time of birth for the individual - *

- */ - public Patient setBirthDate( Date theDate, TemporalPrecisionEnum thePrecision) { - myBirthDate = new DateTimeDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for deceased[x] (Indicates if the individual is deceased or not). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates if the individual is deceased or not - *

- */ - public IDatatype getDeceased() { - return myDeceased; - } - - /** - * Sets the value(s) for deceased[x] (Indicates if the individual is deceased or not) - * - *

- * Definition: - * Indicates if the individual is deceased or not - *

- */ - public Patient setDeceased(IDatatype theValue) { - myDeceased = theValue; - return this; - } - - - /** - * Gets the value(s) for address (Addresses for the individual). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Addresses for the individual - *

- */ - public java.util.List getAddress() { - if (myAddress == null) { - myAddress = new java.util.ArrayList(); - } - return myAddress; - } - - /** - * Sets the value(s) for address (Addresses for the individual) - * - *

- * Definition: - * Addresses for the individual - *

- */ - public Patient setAddress(java.util.List theValue) { - myAddress = theValue; - return this; - } - - /** - * Adds and returns a new value for address (Addresses for the individual) - * - *

- * Definition: - * Addresses for the individual - *

- */ - public AddressDt addAddress() { - AddressDt newType = new AddressDt(); - getAddress().add(newType); - return newType; - } - - /** - * Gets the first repetition for address (Addresses for the individual), - * creating it if it does not already exist. - * - *

- * Definition: - * Addresses for the individual - *

- */ - public AddressDt getAddressFirstRep() { - if (getAddress().isEmpty()) { - return addAddress(); - } - return getAddress().get(0); - } - - /** - * Gets the value(s) for maritalStatus (Marital (civil) status of a person). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * This field contains a patient's most recent marital (civil) status. - *

- */ - public BoundCodeableConceptDt getMaritalStatus() { - if (myMaritalStatus == null) { - myMaritalStatus = new BoundCodeableConceptDt(MaritalStatusCodesEnum.VALUESET_BINDER); - } - return myMaritalStatus; - } - - /** - * Sets the value(s) for maritalStatus (Marital (civil) status of a person) - * - *

- * Definition: - * This field contains a patient's most recent marital (civil) status. - *

- */ - public Patient setMaritalStatus(BoundCodeableConceptDt theValue) { - myMaritalStatus = theValue; - return this; - } - - /** - * Sets the value(s) for maritalStatus (Marital (civil) status of a person) - * - *

- * Definition: - * This field contains a patient's most recent marital (civil) status. - *

- */ - public Patient setMaritalStatus(MaritalStatusCodesEnum theValue) { - getMaritalStatus().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for multipleBirth[x] (Whether patient is part of a multiple birth). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates whether the patient is part of a multiple or indicates the actual birth order. - *

- */ - public IDatatype getMultipleBirth() { - return myMultipleBirth; - } - - /** - * Sets the value(s) for multipleBirth[x] (Whether patient is part of a multiple birth) - * - *

- * Definition: - * Indicates whether the patient is part of a multiple or indicates the actual birth order. - *

- */ - public Patient setMultipleBirth(IDatatype theValue) { - myMultipleBirth = theValue; - return this; - } - - - /** - * Gets the value(s) for photo (Image of the person). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Image of the person - *

- */ - public java.util.List getPhoto() { - if (myPhoto == null) { - myPhoto = new java.util.ArrayList(); - } - return myPhoto; - } - - /** - * Sets the value(s) for photo (Image of the person) - * - *

- * Definition: - * Image of the person - *

- */ - public Patient setPhoto(java.util.List theValue) { - myPhoto = theValue; - return this; - } - - /** - * Adds and returns a new value for photo (Image of the person) - * - *

- * Definition: - * Image of the person - *

- */ - public AttachmentDt addPhoto() { - AttachmentDt newType = new AttachmentDt(); - getPhoto().add(newType); - return newType; - } - - /** - * Gets the first repetition for photo (Image of the person), - * creating it if it does not already exist. - * - *

- * Definition: - * Image of the person - *

- */ - public AttachmentDt getPhotoFirstRep() { - if (getPhoto().isEmpty()) { - return addPhoto(); - } - return getPhoto().get(0); - } - - /** - * Gets the value(s) for contact (A contact party (e.g. guardian, partner, friend) for the patient). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getContact() { - if (myContact == null) { - myContact = new java.util.ArrayList(); - } - return myContact; - } - - /** - * Sets the value(s) for contact (A contact party (e.g. guardian, partner, friend) for the patient) - * - *

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

- */ - public Patient setContact(java.util.List theValue) { - myContact = theValue; - return this; - } - - /** - * Adds and returns a new value for contact (A contact party (e.g. guardian, partner, friend) for the patient) - * - *

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

- */ - public Contact addContact() { - Contact newType = new Contact(); - getContact().add(newType); - return newType; - } - - /** - * Gets the first repetition for contact (A contact party (e.g. guardian, partner, friend) for the patient), - * creating it if it does not already exist. - * - *

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

- */ - public Contact getContactFirstRep() { - if (getContact().isEmpty()) { - return addContact(); - } - return getContact().get(0); - } - - /** - * Gets the value(s) for animal (If this patient is an animal (non-human)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * This element has a value if the patient is an animal - *

- */ - public Animal getAnimal() { - if (myAnimal == null) { - myAnimal = new Animal(); - } - return myAnimal; - } - - /** - * Sets the value(s) for animal (If this patient is an animal (non-human)) - * - *

- * Definition: - * This element has a value if the patient is an animal - *

- */ - public Patient setAnimal(Animal theValue) { - myAnimal = theValue; - return this; - } - - - /** - * Gets the value(s) for communication (Languages which may be used to communicate with the patient about his or her health). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getCommunication() { - if (myCommunication == null) { - myCommunication = new java.util.ArrayList(); - } - return myCommunication; - } - - /** - * Sets the value(s) for communication (Languages which may be used to communicate with the patient about his or her health) - * - *

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

- */ - public Patient setCommunication(java.util.List theValue) { - myCommunication = theValue; - return this; - } - - /** - * Adds and returns a new value for communication (Languages which may be used to communicate with the patient about his or her health) - * - *

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

- */ - public CodeableConceptDt addCommunication() { - CodeableConceptDt newType = new CodeableConceptDt(); - getCommunication().add(newType); - return newType; - } - - /** - * Gets the first repetition for communication (Languages which may be used to communicate with the patient about his or her health), - * creating it if it does not already exist. - * - *

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

- */ - public CodeableConceptDt getCommunicationFirstRep() { - if (getCommunication().isEmpty()) { - return addCommunication(); - } - return getCommunication().get(0); - } - - /** - * Gets the value(s) for careProvider (Patient's nominated care provider). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getCareProvider() { - if (myCareProvider == null) { - myCareProvider = new java.util.ArrayList(); - } - return myCareProvider; - } - - /** - * Sets the value(s) for careProvider (Patient's nominated care provider) - * - *

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

- */ - public Patient setCareProvider(java.util.List theValue) { - myCareProvider = theValue; - return this; - } - - /** - * Adds and returns a new value for careProvider (Patient's nominated care provider) - * - *

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

- */ - public ResourceReferenceDt addCareProvider() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getCareProvider().add(newType); - return newType; - } - - /** - * Gets the value(s) for managingOrganization (Organization that is the custodian of the patient record). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Organization that is the custodian of the patient record - *

- */ - public ResourceReferenceDt getManagingOrganization() { - if (myManagingOrganization == null) { - myManagingOrganization = new ResourceReferenceDt(); - } - return myManagingOrganization; - } - - /** - * Sets the value(s) for managingOrganization (Organization that is the custodian of the patient record) - * - *

- * Definition: - * Organization that is the custodian of the patient record - *

- */ - public Patient setManagingOrganization(ResourceReferenceDt theValue) { - myManagingOrganization = theValue; - return this; - } - - - /** - * Gets the value(s) for link (Link to another patient resource that concerns the same actual person). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getLink() { - if (myLink == null) { - myLink = new java.util.ArrayList(); - } - return myLink; - } - - /** - * Sets the value(s) for link (Link to another patient resource that concerns the same actual person) - * - *

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

- */ - public Patient setLink(java.util.List theValue) { - myLink = theValue; - return this; - } - - /** - * Adds and returns a new value for link (Link to another patient resource that concerns the same actual person) - * - *

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

- */ - public Link addLink() { - Link newType = new Link(); - getLink().add(newType); - return newType; - } - - /** - * Gets the first repetition for link (Link to another patient resource that concerns the same actual person), - * creating it if it does not already exist. - * - *

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

- */ - public Link getLinkFirstRep() { - if (getLink().isEmpty()) { - return addLink(); - } - return getLink().get(0); - } - - /** - * Gets the value(s) for active (Whether this patient's record is in active use). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Whether this patient record is in active use - *

- */ - public BooleanDt getActive() { - if (myActive == null) { - myActive = new BooleanDt(); - } - return myActive; - } - - /** - * Sets the value(s) for active (Whether this patient's record is in active use) - * - *

- * Definition: - * Whether this patient record is in active use - *

- */ - public Patient setActive(BooleanDt theValue) { - myActive = theValue; - return this; - } - - /** - * Sets the value for active (Whether this patient's record is in active use) - * - *

- * Definition: - * Whether this patient record is in active use - *

- */ - public Patient setActive( boolean theBoolean) { - myActive = new BooleanDt(theBoolean); - return this; - } - - - /** - * Block class for child element: Patient.contact (A contact party (e.g. guardian, partner, friend) for the patient) - * - *

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

- */ - @Block() - public static class Contact extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="relationship", type=CodeableConceptDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="The kind of relationship", - formalDefinition="The nature of the relationship between the patient and the contact person" - ) - private java.util.List myRelationship; - - @Child(name="name", type=HumanNameDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="A name associated with the person", - formalDefinition="A name associated with the person" - ) - private HumanNameDt myName; - - @Child(name="telecom", type=ContactDt.class, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="A contact detail for the person", - formalDefinition="A contact detail for the person, e.g. a telephone number or an email address." - ) - private java.util.List myTelecom; - - @Child(name="address", type=AddressDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Address for the contact person", - formalDefinition="Address for the contact person" - ) - private AddressDt myAddress; - - @Child(name="gender", type=CodeableConceptDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="Gender for administrative purposes", - formalDefinition="Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes." - ) - private BoundCodeableConceptDt myGender; - - @Child(name="organization", order=5, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Organization.class }) - @Description( - shortDefinition="Organization that is associated with the contact", - formalDefinition="Organization on behalf of which the contact is acting or for which the contact is working." - ) - private ResourceReferenceDt myOrganization; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myRelationship, myName, myTelecom, myAddress, myGender, myOrganization); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myRelationship, myName, myTelecom, myAddress, myGender, myOrganization); - } - - /** - * Gets the value(s) for relationship (The kind of relationship). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getRelationship() { - if (myRelationship == null) { - myRelationship = new java.util.ArrayList(); - } - return myRelationship; - } - - /** - * Sets the value(s) for relationship (The kind of relationship) - * - *

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

- */ - public Contact setRelationship(java.util.List theValue) { - myRelationship = theValue; - return this; - } - - /** - * Adds and returns a new value for relationship (The kind of relationship) - * - *

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

- */ - public CodeableConceptDt addRelationship() { - CodeableConceptDt newType = new CodeableConceptDt(); - getRelationship().add(newType); - return newType; - } - - /** - * Gets the first repetition for relationship (The kind of relationship), - * creating it if it does not already exist. - * - *

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

- */ - public CodeableConceptDt getRelationshipFirstRep() { - if (getRelationship().isEmpty()) { - return addRelationship(); - } - return getRelationship().get(0); - } - - /** - * Gets the value(s) for name (A name associated with the person). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A name associated with the person - *

- */ - public HumanNameDt getName() { - if (myName == null) { - myName = new HumanNameDt(); - } - return myName; - } - - /** - * Sets the value(s) for name (A name associated with the person) - * - *

- * Definition: - * A name associated with the person - *

- */ - public Contact setName(HumanNameDt theValue) { - myName = theValue; - return this; - } - - - /** - * Gets the value(s) for telecom (A contact detail for the person). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getTelecom() { - if (myTelecom == null) { - myTelecom = new java.util.ArrayList(); - } - return myTelecom; - } - - /** - * Sets the value(s) for telecom (A contact detail for the person) - * - *

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

- */ - public Contact setTelecom(java.util.List theValue) { - myTelecom = theValue; - return this; - } - - /** - * Adds and returns a new value for telecom (A contact detail for the person) - * - *

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

- */ - public ContactDt addTelecom() { - ContactDt newType = new ContactDt(); - getTelecom().add(newType); - return newType; - } - - /** - * Gets the first repetition for telecom (A contact detail for the person), - * creating it if it does not already exist. - * - *

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

- */ - public ContactDt getTelecomFirstRep() { - if (getTelecom().isEmpty()) { - return addTelecom(); - } - return getTelecom().get(0); - } - /** - * Adds a new value for telecom (A contact detail for the person) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Contact 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 (A contact detail for the person) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Contact addTelecom( String theValue) { - if (myTelecom == null) { - myTelecom = new java.util.ArrayList(); - } - myTelecom.add(new ContactDt(theValue)); - return this; - } - - - /** - * Gets the value(s) for address (Address for the contact person). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Address for the contact person - *

- */ - public AddressDt getAddress() { - if (myAddress == null) { - myAddress = new AddressDt(); - } - return myAddress; - } - - /** - * Sets the value(s) for address (Address for the contact person) - * - *

- * Definition: - * Address for the contact person - *

- */ - public Contact setAddress(AddressDt theValue) { - myAddress = theValue; - return this; - } - - - /** - * Gets the value(s) for gender (Gender for administrative purposes). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - *

- */ - public BoundCodeableConceptDt getGender() { - if (myGender == null) { - myGender = new BoundCodeableConceptDt(AdministrativeGenderCodesEnum.VALUESET_BINDER); - } - return myGender; - } - - /** - * Sets the value(s) for gender (Gender for administrative purposes) - * - *

- * Definition: - * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - *

- */ - public Contact setGender(BoundCodeableConceptDt theValue) { - myGender = theValue; - return this; - } - - /** - * Sets the value(s) for gender (Gender for administrative purposes) - * - *

- * Definition: - * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - *

- */ - public Contact setGender(AdministrativeGenderCodesEnum theValue) { - getGender().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for organization (Organization that is associated with the contact). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Organization on behalf of which the contact is acting or for which the contact is working. - *

- */ - public ResourceReferenceDt getOrganization() { - if (myOrganization == null) { - myOrganization = new ResourceReferenceDt(); - } - return myOrganization; - } - - /** - * Sets the value(s) for organization (Organization that is associated with the contact) - * - *

- * Definition: - * Organization on behalf of which the contact is acting or for which the contact is working. - *

- */ - public Contact setOrganization(ResourceReferenceDt theValue) { - myOrganization = theValue; - return this; - } - - - - } - - - /** - * Block class for child element: Patient.animal (If this patient is an animal (non-human)) - * - *

- * Definition: - * This element has a value if the patient is an animal - *

- */ - @Block() - public static class Animal extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="species", type=CodeableConceptDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="E.g. Dog, Cow", - formalDefinition="Identifies the high level categorization of the kind of animal" - ) - private BoundCodeableConceptDt mySpecies; - - @Child(name="breed", type=CodeableConceptDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="E.g. Poodle, Angus", - formalDefinition="Identifies the detailed categorization of the kind of animal." - ) - private CodeableConceptDt myBreed; - - @Child(name="genderStatus", type=CodeableConceptDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="E.g. Neutered, Intact", - formalDefinition="Indicates the current state of the animal's reproductive organs" - ) - private CodeableConceptDt myGenderStatus; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySpecies, myBreed, myGenderStatus); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySpecies, myBreed, myGenderStatus); - } - - /** - * Gets the value(s) for species (E.g. Dog, Cow). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the high level categorization of the kind of animal - *

- */ - public BoundCodeableConceptDt getSpecies() { - if (mySpecies == null) { - mySpecies = new BoundCodeableConceptDt(AnimalSpeciesEnum.VALUESET_BINDER); - } - return mySpecies; - } - - /** - * Sets the value(s) for species (E.g. Dog, Cow) - * - *

- * Definition: - * Identifies the high level categorization of the kind of animal - *

- */ - public Animal setSpecies(BoundCodeableConceptDt theValue) { - mySpecies = theValue; - return this; - } - - /** - * Sets the value(s) for species (E.g. Dog, Cow) - * - *

- * Definition: - * Identifies the high level categorization of the kind of animal - *

- */ - public Animal setSpecies(AnimalSpeciesEnum theValue) { - getSpecies().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for breed (E.g. Poodle, Angus). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the detailed categorization of the kind of animal. - *

- */ - public CodeableConceptDt getBreed() { - if (myBreed == null) { - myBreed = new CodeableConceptDt(); - } - return myBreed; - } - - /** - * Sets the value(s) for breed (E.g. Poodle, Angus) - * - *

- * Definition: - * Identifies the detailed categorization of the kind of animal. - *

- */ - public Animal setBreed(CodeableConceptDt theValue) { - myBreed = theValue; - return this; - } - - - /** - * Gets the value(s) for genderStatus (E.g. Neutered, Intact). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates the current state of the animal's reproductive organs - *

- */ - public CodeableConceptDt getGenderStatus() { - if (myGenderStatus == null) { - myGenderStatus = new CodeableConceptDt(); - } - return myGenderStatus; - } - - /** - * Sets the value(s) for genderStatus (E.g. Neutered, Intact) - * - *

- * Definition: - * Indicates the current state of the animal's reproductive organs - *

- */ - public Animal setGenderStatus(CodeableConceptDt theValue) { - myGenderStatus = theValue; - return this; - } - - - - } - - - /** - * Block class for child element: Patient.link (Link to another patient resource that concerns the same actual person) - * - *

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

- */ - @Block() - public static class Link extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="other", order=0, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="The other patient resource that the link refers to", - formalDefinition="The other patient resource that the link refers to" - ) - private ResourceReferenceDt myOther; - - @Child(name="type", type=CodeDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="replace | refer | seealso - type of link", - formalDefinition="The type of link between this patient resource and another patient resource." - ) - private BoundCodeDt myType; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myOther, myType); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myOther, myType); - } - - /** - * Gets the value(s) for other (The other patient resource that the link refers to). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The other patient resource that the link refers to - *

- */ - public ResourceReferenceDt getOther() { - if (myOther == null) { - myOther = new ResourceReferenceDt(); - } - return myOther; - } - - /** - * Sets the value(s) for other (The other patient resource that the link refers to) - * - *

- * Definition: - * The other patient resource that the link refers to - *

- */ - public Link setOther(ResourceReferenceDt theValue) { - myOther = theValue; - return this; - } - - - /** - * Gets the value(s) for type (replace | refer | seealso - type of link). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The type of link between this patient resource and another patient resource. - *

- */ - public BoundCodeDt getType() { - if (myType == null) { - myType = new BoundCodeDt(LinkTypeEnum.VALUESET_BINDER); - } - return myType; - } - - /** - * Sets the value(s) for type (replace | refer | seealso - type of link) - * - *

- * Definition: - * The type of link between this patient resource and another patient resource. - *

- */ - public Link setType(BoundCodeDt theValue) { - myType = theValue; - return this; - } - - /** - * Sets the value(s) for type (replace | refer | seealso - type of link) - * - *

- * Definition: - * The type of link between this patient resource and another patient resource. - *

- */ - public Link setType(LinkTypeEnum theValue) { - getType().setValueAsEnum(theValue); - return this; - } - - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Practitioner.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Practitioner.java deleted file mode 100644 index 1a809268ab3..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Practitioner.java +++ /dev/null @@ -1,1373 +0,0 @@ - - - - - - - - - - - - - - - - -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.dstu.composite.AddressDt; -import ca.uhn.fhir.model.dstu.composite.AttachmentDt; -import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.ContactDt; -import ca.uhn.fhir.model.dstu.composite.HumanNameDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.PractitionerRoleEnum; -import ca.uhn.fhir.model.dstu.valueset.PractitionerSpecialtyEnum; -import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; -import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.StringClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR Practitioner Resource - * (A person with a formal responsibility in the provisioning of healthcare or related services) - * - *

- * Definition: - * A person who is directly or indirectly involved in the provisioning of healthcare - *

- * - *

- * Requirements: - * Need to track doctors, staff, locums etc. for both healthcare practitioners, funders, etc. - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Practitioner - *

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

- * Description: A practitioner's Identifier
- * Type: token
- * Path: Practitioner.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Practitioner.identifier", description="A practitioner's Identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - - /** - * Fluent Client search parameter constant for identifier - *

- * Description: A practitioner's Identifier
- * Type: token
- * Path: Practitioner.identifier
- *

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

- * Description: A portion of either family or given name
- * Type: string
- * Path: Practitioner.name
- *

- */ - @SearchParamDefinition(name="name", path="Practitioner.name", description="A portion of either family or given name", type="string" ) - public static final String SP_NAME = "name"; - - /** - * Fluent Client search parameter constant for name - *

- * Description: A portion of either family or given name
- * Type: string
- * Path: Practitioner.name
- *

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

- * Description: A portion of the family name
- * Type: string
- * Path: Practitioner.name
- *

- */ - @SearchParamDefinition(name="family", path="Practitioner.name", description="A portion of the family name", type="string" ) - public static final String SP_FAMILY = "family"; - - /** - * Fluent Client search parameter constant for family - *

- * Description: A portion of the family name
- * Type: string
- * Path: Practitioner.name
- *

- */ - public static final StringClientParam FAMILY = new StringClientParam(SP_FAMILY); - - /** - * Search parameter constant for given - *

- * Description: A portion of the given name
- * Type: string
- * Path: Practitioner.name
- *

- */ - @SearchParamDefinition(name="given", path="Practitioner.name", description="A portion of the given name", type="string" ) - public static final String SP_GIVEN = "given"; - - /** - * Fluent Client search parameter constant for given - *

- * Description: A portion of the given name
- * Type: string
- * Path: Practitioner.name
- *

- */ - public static final StringClientParam GIVEN = new StringClientParam(SP_GIVEN); - - /** - * Search parameter constant for phonetic - *

- * Description: A portion of either family or given name using some kind of phonetic matching algorithm
- * Type: string
- * Path: Practitioner.name
- *

- */ - @SearchParamDefinition(name="phonetic", path="Practitioner.name", description="A portion of either family or given name using some kind of phonetic matching algorithm", type="string" ) - public static final String SP_PHONETIC = "phonetic"; - - /** - * Fluent Client search parameter constant for phonetic - *

- * Description: A portion of either family or given name using some kind of phonetic matching algorithm
- * Type: string
- * Path: Practitioner.name
- *

- */ - public static final StringClientParam PHONETIC = new StringClientParam(SP_PHONETIC); - - /** - * Search parameter constant for telecom - *

- * Description: The value in any kind of contact
- * Type: string
- * Path: Practitioner.telecom
- *

- */ - @SearchParamDefinition(name="telecom", path="Practitioner.telecom", description="The value in any kind of contact", type="string" ) - public static final String SP_TELECOM = "telecom"; - - /** - * Fluent Client search parameter constant for telecom - *

- * Description: The value in any kind of contact
- * Type: string
- * Path: Practitioner.telecom
- *

- */ - public static final StringClientParam TELECOM = new StringClientParam(SP_TELECOM); - - /** - * Search parameter constant for address - *

- * Description: An address in any kind of address/part
- * Type: string
- * Path: Practitioner.address
- *

- */ - @SearchParamDefinition(name="address", path="Practitioner.address", description="An address in any kind of address/part", type="string" ) - public static final String SP_ADDRESS = "address"; - - /** - * Fluent Client search parameter constant for address - *

- * Description: An address in any kind of address/part
- * Type: string
- * Path: Practitioner.address
- *

- */ - public static final StringClientParam ADDRESS = new StringClientParam(SP_ADDRESS); - - /** - * Search parameter constant for gender - *

- * Description: Gender of the practitioner
- * Type: token
- * Path: Practitioner.gender
- *

- */ - @SearchParamDefinition(name="gender", path="Practitioner.gender", description="Gender of the practitioner", type="token" ) - public static final String SP_GENDER = "gender"; - - /** - * Fluent Client search parameter constant for gender - *

- * Description: Gender of the practitioner
- * Type: token
- * Path: Practitioner.gender
- *

- */ - public static final TokenClientParam GENDER = new TokenClientParam(SP_GENDER); - - /** - * Search parameter constant for organization - *

- * Description: The identity of the organization the practitioner represents / acts on behalf of
- * Type: reference
- * Path: Practitioner.organization
- *

- */ - @SearchParamDefinition(name="organization", path="Practitioner.organization", description="The identity of the organization the practitioner represents / acts on behalf of", type="reference" ) - public static final String SP_ORGANIZATION = "organization"; - - /** - * Fluent Client search parameter constant for organization - *

- * Description: The identity of the organization the practitioner represents / acts on behalf of
- * Type: reference
- * Path: Practitioner.organization
- *

- */ - public static final ReferenceClientParam ORGANIZATION = new ReferenceClientParam(SP_ORGANIZATION); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Practitioner.organization". - */ - public static final Include INCLUDE_ORGANIZATION = new Include("Practitioner.organization"); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="A identifier for the person as this agent", - formalDefinition="An identifier that applies to this person in this role" - ) - private java.util.List myIdentifier; - - @Child(name="name", type=HumanNameDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="A name associated with the person", - formalDefinition="A name associated with the person" - ) - private HumanNameDt myName; - - @Child(name="telecom", type=ContactDt.class, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="A contact detail for the practitioner", - formalDefinition="A contact detail for the practitioner, e.g. a telephone number or an email address." - ) - private java.util.List myTelecom; - - @Child(name="address", type=AddressDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Where practitioner can be found/visited", - formalDefinition="The postal address where the practitioner can be found or visited or to which mail can be delivered" - ) - private AddressDt myAddress; - - @Child(name="gender", type=CodeableConceptDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="Gender for administrative purposes", - formalDefinition="Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes." - ) - private BoundCodeableConceptDt myGender; - - @Child(name="birthDate", type=DateTimeDt.class, order=5, min=0, max=1) - @Description( - shortDefinition="The date and time of birth for the practitioner", - formalDefinition="The date and time of birth for the practitioner" - ) - private DateTimeDt myBirthDate; - - @Child(name="photo", type=AttachmentDt.class, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Image of the person", - formalDefinition="Image of the person" - ) - private java.util.List myPhoto; - - @Child(name="organization", order=7, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Organization.class }) - @Description( - shortDefinition="The represented organization", - formalDefinition="The organization that the practitioner represents" - ) - private ResourceReferenceDt myOrganization; - - @Child(name="role", type=CodeableConceptDt.class, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Roles which this practitioner may perform", - formalDefinition="Roles which this practitioner is authorized to perform for the organization" - ) - private java.util.List> myRole; - - @Child(name="specialty", type=CodeableConceptDt.class, order=9, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Specific specialty of the practitioner", - formalDefinition="Specific specialty of the practitioner" - ) - private java.util.List> mySpecialty; - - @Child(name="period", type=PeriodDt.class, order=10, min=0, max=1) - @Description( - shortDefinition="The period during which the practitioner is authorized to perform in these role(s)", - formalDefinition="The period during which the person is authorized to act as a practitioner in these role(s) for the organization" - ) - private PeriodDt myPeriod; - - @Child(name="location", order=11, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Location.class }) - @Description( - shortDefinition="The location(s) at which this practitioner provides care", - formalDefinition="The location(s) at which this practitioner provides care" - ) - private java.util.List myLocation; - - @Child(name="qualification", order=12, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Qualifications obtained by training and certification", - formalDefinition="" - ) - private java.util.List myQualification; - - @Child(name="communication", type=CodeableConceptDt.class, order=13, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="A language the practitioner is able to use in patient communication", - formalDefinition="A language the practitioner is able to use in patient communication" - ) - private java.util.List myCommunication; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myName, myTelecom, myAddress, myGender, myBirthDate, myPhoto, myOrganization, myRole, mySpecialty, myPeriod, myLocation, myQualification, myCommunication); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myName, myTelecom, myAddress, myGender, myBirthDate, myPhoto, myOrganization, myRole, mySpecialty, myPeriod, myLocation, myQualification, myCommunication); - } - - /** - * Gets the value(s) for identifier (A identifier for the person as this agent). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (A identifier for the person as this agent) - * - *

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

- */ - public Practitioner setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (A identifier for the person as this agent) - * - *

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

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (A identifier for the person as this agent), - * creating it if it does not already exist. - * - *

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

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (A identifier for the person as this agent) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Practitioner addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (A identifier for the person as this agent) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Practitioner addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for name (A name associated with the person). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A name associated with the person - *

- */ - public HumanNameDt getName() { - if (myName == null) { - myName = new HumanNameDt(); - } - return myName; - } - - /** - * Sets the value(s) for name (A name associated with the person) - * - *

- * Definition: - * A name associated with the person - *

- */ - public Practitioner setName(HumanNameDt theValue) { - myName = theValue; - return this; - } - - - /** - * Gets the value(s) for telecom (A contact detail for the practitioner). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getTelecom() { - if (myTelecom == null) { - myTelecom = new java.util.ArrayList(); - } - return myTelecom; - } - - /** - * Sets the value(s) for telecom (A contact detail for the practitioner) - * - *

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

- */ - public Practitioner setTelecom(java.util.List theValue) { - myTelecom = theValue; - return this; - } - - /** - * Adds and returns a new value for telecom (A contact detail for the practitioner) - * - *

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

- */ - public ContactDt addTelecom() { - ContactDt newType = new ContactDt(); - getTelecom().add(newType); - return newType; - } - - /** - * Gets the first repetition for telecom (A contact detail for the practitioner), - * creating it if it does not already exist. - * - *

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

- */ - public ContactDt getTelecomFirstRep() { - if (getTelecom().isEmpty()) { - return addTelecom(); - } - return getTelecom().get(0); - } - /** - * Adds a new value for telecom (A contact detail for the practitioner) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Practitioner 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 (A contact detail for the practitioner) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Practitioner addTelecom( String theValue) { - if (myTelecom == null) { - myTelecom = new java.util.ArrayList(); - } - myTelecom.add(new ContactDt(theValue)); - return this; - } - - - /** - * Gets the value(s) for address (Where practitioner can be found/visited). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The postal address where the practitioner can be found or visited or to which mail can be delivered - *

- */ - public AddressDt getAddress() { - if (myAddress == null) { - myAddress = new AddressDt(); - } - return myAddress; - } - - /** - * Sets the value(s) for address (Where practitioner can be found/visited) - * - *

- * Definition: - * The postal address where the practitioner can be found or visited or to which mail can be delivered - *

- */ - public Practitioner setAddress(AddressDt theValue) { - myAddress = theValue; - return this; - } - - - /** - * Gets the value(s) for gender (Gender for administrative purposes). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - *

- */ - public BoundCodeableConceptDt getGender() { - if (myGender == null) { - myGender = new BoundCodeableConceptDt(AdministrativeGenderCodesEnum.VALUESET_BINDER); - } - return myGender; - } - - /** - * Sets the value(s) for gender (Gender for administrative purposes) - * - *

- * Definition: - * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - *

- */ - public Practitioner setGender(BoundCodeableConceptDt theValue) { - myGender = theValue; - return this; - } - - /** - * Sets the value(s) for gender (Gender for administrative purposes) - * - *

- * Definition: - * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - *

- */ - public Practitioner setGender(AdministrativeGenderCodesEnum theValue) { - getGender().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for birthDate (The date and time of birth for the practitioner). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The date and time of birth for the practitioner - *

- */ - public DateTimeDt getBirthDate() { - if (myBirthDate == null) { - myBirthDate = new DateTimeDt(); - } - return myBirthDate; - } - - /** - * Sets the value(s) for birthDate (The date and time of birth for the practitioner) - * - *

- * Definition: - * The date and time of birth for the practitioner - *

- */ - public Practitioner setBirthDate(DateTimeDt theValue) { - myBirthDate = theValue; - return this; - } - - /** - * Sets the value for birthDate (The date and time of birth for the practitioner) - * - *

- * Definition: - * The date and time of birth for the practitioner - *

- */ - public Practitioner setBirthDateWithSecondsPrecision( Date theDate) { - myBirthDate = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for birthDate (The date and time of birth for the practitioner) - * - *

- * Definition: - * The date and time of birth for the practitioner - *

- */ - public Practitioner setBirthDate( Date theDate, TemporalPrecisionEnum thePrecision) { - myBirthDate = new DateTimeDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for photo (Image of the person). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Image of the person - *

- */ - public java.util.List getPhoto() { - if (myPhoto == null) { - myPhoto = new java.util.ArrayList(); - } - return myPhoto; - } - - /** - * Sets the value(s) for photo (Image of the person) - * - *

- * Definition: - * Image of the person - *

- */ - public Practitioner setPhoto(java.util.List theValue) { - myPhoto = theValue; - return this; - } - - /** - * Adds and returns a new value for photo (Image of the person) - * - *

- * Definition: - * Image of the person - *

- */ - public AttachmentDt addPhoto() { - AttachmentDt newType = new AttachmentDt(); - getPhoto().add(newType); - return newType; - } - - /** - * Gets the first repetition for photo (Image of the person), - * creating it if it does not already exist. - * - *

- * Definition: - * Image of the person - *

- */ - public AttachmentDt getPhotoFirstRep() { - if (getPhoto().isEmpty()) { - return addPhoto(); - } - return getPhoto().get(0); - } - - /** - * Gets the value(s) for organization (The represented organization). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The organization that the practitioner represents - *

- */ - public ResourceReferenceDt getOrganization() { - if (myOrganization == null) { - myOrganization = new ResourceReferenceDt(); - } - return myOrganization; - } - - /** - * Sets the value(s) for organization (The represented organization) - * - *

- * Definition: - * The organization that the practitioner represents - *

- */ - public Practitioner setOrganization(ResourceReferenceDt theValue) { - myOrganization = theValue; - return this; - } - - - /** - * Gets the value(s) for role (Roles which this practitioner may perform). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Roles which this practitioner is authorized to perform for the organization - *

- */ - public java.util.List> getRole() { - if (myRole == null) { - myRole = new java.util.ArrayList>(); - } - return myRole; - } - - /** - * Sets the value(s) for role (Roles which this practitioner may perform) - * - *

- * Definition: - * Roles which this practitioner is authorized to perform for the organization - *

- */ - public Practitioner setRole(java.util.List> theValue) { - myRole = theValue; - return this; - } - - /** - * Add a value for role (Roles which this practitioner may perform) 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: - * Roles which this practitioner is authorized to perform for the organization - *

- */ - public BoundCodeableConceptDt addRole(PractitionerRoleEnum theValue) { - BoundCodeableConceptDt retVal = new BoundCodeableConceptDt(PractitionerRoleEnum.VALUESET_BINDER, theValue); - getRole().add(retVal); - return retVal; - } - - /** - * Gets the first repetition for role (Roles which this practitioner may perform), - * creating it if it does not already exist. - * - *

- * Definition: - * Roles which this practitioner is authorized to perform for the organization - *

- */ - public BoundCodeableConceptDt getRoleFirstRep() { - if (getRole().size() == 0) { - addRole(); - } - return getRole().get(0); - } - - /** - * Add a value for role (Roles which this practitioner may perform) - * - *

- * Definition: - * Roles which this practitioner is authorized to perform for the organization - *

- */ - public BoundCodeableConceptDt addRole() { - BoundCodeableConceptDt retVal = new BoundCodeableConceptDt(PractitionerRoleEnum.VALUESET_BINDER); - getRole().add(retVal); - return retVal; - } - - /** - * Sets the value(s), and clears any existing value(s) for role (Roles which this practitioner may perform) - * - *

- * Definition: - * Roles which this practitioner is authorized to perform for the organization - *

- */ - public Practitioner setRole(PractitionerRoleEnum theValue) { - getRole().clear(); - addRole(theValue); - return this; - } - - - /** - * Gets the value(s) for specialty (Specific specialty of the practitioner). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Specific specialty of the practitioner - *

- */ - public java.util.List> getSpecialty() { - if (mySpecialty == null) { - mySpecialty = new java.util.ArrayList>(); - } - return mySpecialty; - } - - /** - * Sets the value(s) for specialty (Specific specialty of the practitioner) - * - *

- * Definition: - * Specific specialty of the practitioner - *

- */ - public Practitioner setSpecialty(java.util.List> theValue) { - mySpecialty = theValue; - return this; - } - - /** - * Add a value for specialty (Specific specialty of the practitioner) 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: - * Specific specialty of the practitioner - *

- */ - public BoundCodeableConceptDt addSpecialty(PractitionerSpecialtyEnum theValue) { - BoundCodeableConceptDt retVal = new BoundCodeableConceptDt(PractitionerSpecialtyEnum.VALUESET_BINDER, theValue); - getSpecialty().add(retVal); - return retVal; - } - - /** - * Gets the first repetition for specialty (Specific specialty of the practitioner), - * creating it if it does not already exist. - * - *

- * Definition: - * Specific specialty of the practitioner - *

- */ - public BoundCodeableConceptDt getSpecialtyFirstRep() { - if (getSpecialty().size() == 0) { - addSpecialty(); - } - return getSpecialty().get(0); - } - - /** - * Add a value for specialty (Specific specialty of the practitioner) - * - *

- * Definition: - * Specific specialty of the practitioner - *

- */ - public BoundCodeableConceptDt addSpecialty() { - BoundCodeableConceptDt retVal = new BoundCodeableConceptDt(PractitionerSpecialtyEnum.VALUESET_BINDER); - getSpecialty().add(retVal); - return retVal; - } - - /** - * Sets the value(s), and clears any existing value(s) for specialty (Specific specialty of the practitioner) - * - *

- * Definition: - * Specific specialty of the practitioner - *

- */ - public Practitioner setSpecialty(PractitionerSpecialtyEnum theValue) { - getSpecialty().clear(); - addSpecialty(theValue); - return this; - } - - - /** - * Gets the value(s) for period (The period during which the practitioner is authorized to perform in these role(s)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The period during which the person is authorized to act as a practitioner in these role(s) for the organization - *

- */ - public PeriodDt getPeriod() { - if (myPeriod == null) { - myPeriod = new PeriodDt(); - } - return myPeriod; - } - - /** - * Sets the value(s) for period (The period during which the practitioner is authorized to perform in these role(s)) - * - *

- * Definition: - * The period during which the person is authorized to act as a practitioner in these role(s) for the organization - *

- */ - public Practitioner setPeriod(PeriodDt theValue) { - myPeriod = theValue; - return this; - } - - - /** - * Gets the value(s) for location (The location(s) at which this practitioner provides care). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getLocation() { - if (myLocation == null) { - myLocation = new java.util.ArrayList(); - } - return myLocation; - } - - /** - * Sets the value(s) for location (The location(s) at which this practitioner provides care) - * - *

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

- */ - public Practitioner setLocation(java.util.List theValue) { - myLocation = theValue; - return this; - } - - /** - * Adds and returns a new value for location (The location(s) at which this practitioner provides care) - * - *

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

- */ - public ResourceReferenceDt addLocation() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getLocation().add(newType); - return newType; - } - - /** - * Gets the value(s) for qualification (Qualifications obtained by training and certification). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getQualification() { - if (myQualification == null) { - myQualification = new java.util.ArrayList(); - } - return myQualification; - } - - /** - * Sets the value(s) for qualification (Qualifications obtained by training and certification) - * - *

- * Definition: - * - *

- */ - public Practitioner setQualification(java.util.List theValue) { - myQualification = theValue; - return this; - } - - /** - * Adds and returns a new value for qualification (Qualifications obtained by training and certification) - * - *

- * Definition: - * - *

- */ - public Qualification addQualification() { - Qualification newType = new Qualification(); - getQualification().add(newType); - return newType; - } - - /** - * Gets the first repetition for qualification (Qualifications obtained by training and certification), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public Qualification getQualificationFirstRep() { - if (getQualification().isEmpty()) { - return addQualification(); - } - return getQualification().get(0); - } - - /** - * Gets the value(s) for communication (A language the practitioner is able to use in patient communication). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getCommunication() { - if (myCommunication == null) { - myCommunication = new java.util.ArrayList(); - } - return myCommunication; - } - - /** - * Sets the value(s) for communication (A language the practitioner is able to use in patient communication) - * - *

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

- */ - public Practitioner setCommunication(java.util.List theValue) { - myCommunication = theValue; - return this; - } - - /** - * Adds and returns a new value for communication (A language the practitioner is able to use in patient communication) - * - *

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

- */ - public CodeableConceptDt addCommunication() { - CodeableConceptDt newType = new CodeableConceptDt(); - getCommunication().add(newType); - return newType; - } - - /** - * Gets the first repetition for communication (A language the practitioner is able to use in patient communication), - * creating it if it does not already exist. - * - *

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

- */ - public CodeableConceptDt getCommunicationFirstRep() { - if (getCommunication().isEmpty()) { - return addCommunication(); - } - return getCommunication().get(0); - } - - /** - * Block class for child element: Practitioner.qualification (Qualifications obtained by training and certification) - * - *

- * Definition: - * - *

- */ - @Block() - public static class Qualification extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="code", type=CodeableConceptDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Coded representation of the qualification", - formalDefinition="" - ) - private CodeableConceptDt myCode; - - @Child(name="period", type=PeriodDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Period during which the qualification is valid", - formalDefinition="Period during which the qualification is valid" - ) - private PeriodDt myPeriod; - - @Child(name="issuer", order=2, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Organization.class }) - @Description( - shortDefinition="Organization that regulates and issues the qualification", - formalDefinition="Organization that regulates and issues the qualification" - ) - private ResourceReferenceDt myIssuer; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCode, myPeriod, myIssuer); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCode, myPeriod, myIssuer); - } - - /** - * Gets the value(s) for code (Coded representation of the qualification). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public CodeableConceptDt getCode() { - if (myCode == null) { - myCode = new CodeableConceptDt(); - } - return myCode; - } - - /** - * Sets the value(s) for code (Coded representation of the qualification) - * - *

- * Definition: - * - *

- */ - public Qualification setCode(CodeableConceptDt theValue) { - myCode = theValue; - return this; - } - - - /** - * Gets the value(s) for period (Period during which the qualification is valid). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Period during which the qualification is valid - *

- */ - public PeriodDt getPeriod() { - if (myPeriod == null) { - myPeriod = new PeriodDt(); - } - return myPeriod; - } - - /** - * Sets the value(s) for period (Period during which the qualification is valid) - * - *

- * Definition: - * Period during which the qualification is valid - *

- */ - public Qualification setPeriod(PeriodDt theValue) { - myPeriod = theValue; - return this; - } - - - /** - * Gets the value(s) for issuer (Organization that regulates and issues the qualification). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Organization that regulates and issues the qualification - *

- */ - public ResourceReferenceDt getIssuer() { - if (myIssuer == null) { - myIssuer = new ResourceReferenceDt(); - } - return myIssuer; - } - - /** - * Sets the value(s) for issuer (Organization that regulates and issues the qualification) - * - *

- * Definition: - * Organization that regulates and issues the qualification - *

- */ - public Qualification setIssuer(ResourceReferenceDt theValue) { - myIssuer = theValue; - return this; - } - - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Procedure.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Procedure.java deleted file mode 100644 index 85868e468fc..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Procedure.java +++ /dev/null @@ -1,1189 +0,0 @@ - - - - - - - - - - - - - - - - -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.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.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.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.ProcedureRelationshipTypeEnum; -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.rest.gclient.DateClientParam; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR Procedure Resource - * (An action that is performed on a patient) - * - *

- * Definition: - * An action that is performed on a patient. This can be a physical 'thing' like an operation, or less invasive like counseling or hypnotherapy - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Procedure - *

- * - */ -@ResourceDef(name="Procedure", profile="http://hl7.org/fhir/profiles/Procedure", id="procedure") -public class Procedure extends BaseResource implements IResource { - - /** - * Search parameter constant for type - *

- * Description: Type of procedure
- * Type: token
- * Path: Procedure.type
- *

- */ - @SearchParamDefinition(name="type", path="Procedure.type", description="Type of procedure", type="token" ) - public static final String SP_TYPE = "type"; - - /** - * Fluent Client search parameter constant for type - *

- * Description: Type of procedure
- * Type: token
- * Path: Procedure.type
- *

- */ - public static final TokenClientParam TYPE = new TokenClientParam(SP_TYPE); - - /** - * Search parameter constant for subject - *

- * Description: The identity of a patient to list procedures for
- * Type: reference
- * Path: Procedure.subject
- *

- */ - @SearchParamDefinition(name="subject", path="Procedure.subject", description="The identity of a patient to list procedures for", type="reference" ) - public static final String SP_SUBJECT = "subject"; - - /** - * Fluent Client search parameter constant for subject - *

- * Description: The identity of a patient to list procedures for
- * Type: reference
- * Path: Procedure.subject
- *

- */ - public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Procedure.subject". - */ - public static final Include INCLUDE_SUBJECT = new Include("Procedure.subject"); - - /** - * Search parameter constant for date - *

- * Description: The date the procedure was performed on
- * Type: date
- * Path: Procedure.date
- *

- */ - @SearchParamDefinition(name="date", path="Procedure.date", description="The date the procedure was performed on", type="date" ) - public static final String SP_DATE = "date"; - - /** - * Fluent Client search parameter constant for date - *

- * Description: The date the procedure was performed on
- * Type: date
- * Path: Procedure.date
- *

- */ - public static final DateClientParam DATE = new DateClientParam(SP_DATE); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="External Ids for this procedure", - formalDefinition="This records identifiers associated with this procedure that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)" - ) - private java.util.List myIdentifier; - - @Child(name="subject", order=1, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="Who procedure was performed on", - formalDefinition="The person on whom the procedure was performed" - ) - private ResourceReferenceDt mySubject; - - @Child(name="type", type=CodeableConceptDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="Identification of the procedure", - formalDefinition="The specific procedure that is performed. Use text if the exact nature of the procedure can't be coded" - ) - private CodeableConceptDt myType; - - @Child(name="bodySite", type=CodeableConceptDt.class, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Precise location details", - formalDefinition="Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion" - ) - private java.util.List myBodySite; - - @Child(name="indication", type=CodeableConceptDt.class, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Reason procedure performed", - formalDefinition="The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text" - ) - private java.util.List myIndication; - - @Child(name="performer", order=5, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="The people who performed the procedure", - formalDefinition="Limited to 'real' people rather than equipment" - ) - private java.util.List myPerformer; - - @Child(name="date", type=PeriodDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="The date the procedure was performed", - formalDefinition="The dates over which the procedure was performed. Allows a period to support complex procedures that span more that one date, and also allows for the length of the procedure to be captured." - ) - private PeriodDt myDate; - - @Child(name="encounter", order=7, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Encounter.class }) - @Description( - shortDefinition="The encounter when procedure performed", - formalDefinition="The encounter during which the procedure was performed" - ) - private ResourceReferenceDt myEncounter; - - @Child(name="outcome", type=StringDt.class, order=8, min=0, max=1) - @Description( - shortDefinition="What was result of procedure?", - formalDefinition="What was the outcome of the procedure - did it resolve reasons why the procedure was performed?" - ) - private StringDt myOutcome; - - @Child(name="report", order=9, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.DiagnosticReport.class }) - @Description( - shortDefinition="Any report that results from the procedure", - formalDefinition="This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies" - ) - private java.util.List myReport; - - @Child(name="complication", type=CodeableConceptDt.class, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Complication following the procedure", - formalDefinition="Any complications that occurred during the procedure, or in the immediate post-operative period. These are generally tracked separately from the notes, which typically will describe the procedure itself rather than any 'post procedure' issues" - ) - private java.util.List myComplication; - - @Child(name="followUp", type=StringDt.class, order=11, min=0, max=1) - @Description( - shortDefinition="Instructions for follow up", - formalDefinition="If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or potentially could be more complex in which case the CarePlan resource can be used" - ) - private StringDt myFollowUp; - - @Child(name="relatedItem", order=12, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="A procedure that is related to this one", - formalDefinition="Procedures may be related to other items such as procedures or medications. For example treating wound dehiscence following a previous procedure" - ) - private java.util.List myRelatedItem; - - @Child(name="notes", type=StringDt.class, order=13, min=0, max=1) - @Description( - shortDefinition="Additional information about procedure", - formalDefinition="Any other notes about the procedure - e.g. the operative notes" - ) - private StringDt myNotes; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, mySubject, myType, myBodySite, myIndication, myPerformer, myDate, myEncounter, myOutcome, myReport, myComplication, myFollowUp, myRelatedItem, myNotes); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, mySubject, myType, myBodySite, myIndication, myPerformer, myDate, myEncounter, myOutcome, myReport, myComplication, myFollowUp, myRelatedItem, myNotes); - } - - /** - * Gets the value(s) for identifier (External Ids for this procedure). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * This records identifiers associated with this procedure that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (External Ids for this procedure) - * - *

- * Definition: - * This records identifiers associated with this procedure that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public Procedure setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (External Ids for this procedure) - * - *

- * Definition: - * This records identifiers associated with this procedure that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (External Ids for this procedure), - * creating it if it does not already exist. - * - *

- * Definition: - * This records identifiers associated with this procedure that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (External Ids for this procedure) - * - *

- * Definition: - * This records identifiers associated with this procedure that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Procedure addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (External Ids for this procedure) - * - *

- * Definition: - * This records identifiers associated with this procedure that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Procedure addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for subject (Who procedure was performed on). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The person on whom the procedure was performed - *

- */ - public ResourceReferenceDt getSubject() { - if (mySubject == null) { - mySubject = new ResourceReferenceDt(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (Who procedure was performed on) - * - *

- * Definition: - * The person on whom the procedure was performed - *

- */ - public Procedure setSubject(ResourceReferenceDt theValue) { - mySubject = theValue; - return this; - } - - - /** - * Gets the value(s) for type (Identification of the procedure). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The specific procedure that is performed. Use text if the exact nature of the procedure can't be coded - *

- */ - public CodeableConceptDt getType() { - if (myType == null) { - myType = new CodeableConceptDt(); - } - return myType; - } - - /** - * Sets the value(s) for type (Identification of the procedure) - * - *

- * Definition: - * The specific procedure that is performed. Use text if the exact nature of the procedure can't be coded - *

- */ - public Procedure setType(CodeableConceptDt theValue) { - myType = theValue; - return this; - } - - - /** - * Gets the value(s) for bodySite (Precise location details). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion - *

- */ - public java.util.List getBodySite() { - if (myBodySite == null) { - myBodySite = new java.util.ArrayList(); - } - return myBodySite; - } - - /** - * Sets the value(s) for bodySite (Precise location details) - * - *

- * Definition: - * Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion - *

- */ - public Procedure setBodySite(java.util.List theValue) { - myBodySite = theValue; - return this; - } - - /** - * Adds and returns a new value for bodySite (Precise location details) - * - *

- * Definition: - * Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion - *

- */ - public CodeableConceptDt addBodySite() { - CodeableConceptDt newType = new CodeableConceptDt(); - getBodySite().add(newType); - return newType; - } - - /** - * Gets the first repetition for bodySite (Precise location details), - * creating it if it does not already exist. - * - *

- * Definition: - * Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion - *

- */ - public CodeableConceptDt getBodySiteFirstRep() { - if (getBodySite().isEmpty()) { - return addBodySite(); - } - return getBodySite().get(0); - } - - /** - * Gets the value(s) for indication (Reason procedure performed). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text - *

- */ - public java.util.List getIndication() { - if (myIndication == null) { - myIndication = new java.util.ArrayList(); - } - return myIndication; - } - - /** - * Sets the value(s) for indication (Reason procedure performed) - * - *

- * Definition: - * The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text - *

- */ - public Procedure setIndication(java.util.List theValue) { - myIndication = theValue; - return this; - } - - /** - * Adds and returns a new value for indication (Reason procedure performed) - * - *

- * Definition: - * The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text - *

- */ - public CodeableConceptDt addIndication() { - CodeableConceptDt newType = new CodeableConceptDt(); - getIndication().add(newType); - return newType; - } - - /** - * Gets the first repetition for indication (Reason procedure performed), - * creating it if it does not already exist. - * - *

- * Definition: - * The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text - *

- */ - public CodeableConceptDt getIndicationFirstRep() { - if (getIndication().isEmpty()) { - return addIndication(); - } - return getIndication().get(0); - } - - /** - * Gets the value(s) for performer (The people who performed the procedure). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Limited to 'real' people rather than equipment - *

- */ - public java.util.List getPerformer() { - if (myPerformer == null) { - myPerformer = new java.util.ArrayList(); - } - return myPerformer; - } - - /** - * Sets the value(s) for performer (The people who performed the procedure) - * - *

- * Definition: - * Limited to 'real' people rather than equipment - *

- */ - public Procedure setPerformer(java.util.List theValue) { - myPerformer = theValue; - return this; - } - - /** - * Adds and returns a new value for performer (The people who performed the procedure) - * - *

- * Definition: - * Limited to 'real' people rather than equipment - *

- */ - public Performer addPerformer() { - Performer newType = new Performer(); - getPerformer().add(newType); - return newType; - } - - /** - * Gets the first repetition for performer (The people who performed the procedure), - * creating it if it does not already exist. - * - *

- * Definition: - * Limited to 'real' people rather than equipment - *

- */ - public Performer getPerformerFirstRep() { - if (getPerformer().isEmpty()) { - return addPerformer(); - } - return getPerformer().get(0); - } - - /** - * Gets the value(s) for date (The date the procedure was performed). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The dates over which the procedure was performed. Allows a period to support complex procedures that span more that one date, and also allows for the length of the procedure to be captured. - *

- */ - public PeriodDt getDate() { - if (myDate == null) { - myDate = new PeriodDt(); - } - return myDate; - } - - /** - * Sets the value(s) for date (The date the procedure was performed) - * - *

- * Definition: - * The dates over which the procedure was performed. Allows a period to support complex procedures that span more that one date, and also allows for the length of the procedure to be captured. - *

- */ - public Procedure setDate(PeriodDt theValue) { - myDate = theValue; - return this; - } - - - /** - * Gets the value(s) for encounter (The encounter when procedure performed). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The encounter during which the procedure was performed - *

- */ - public ResourceReferenceDt getEncounter() { - if (myEncounter == null) { - myEncounter = new ResourceReferenceDt(); - } - return myEncounter; - } - - /** - * Sets the value(s) for encounter (The encounter when procedure performed) - * - *

- * Definition: - * The encounter during which the procedure was performed - *

- */ - public Procedure setEncounter(ResourceReferenceDt theValue) { - myEncounter = theValue; - return this; - } - - - /** - * Gets the value(s) for outcome (What was result of procedure?). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * What was the outcome of the procedure - did it resolve reasons why the procedure was performed? - *

- */ - public StringDt getOutcome() { - if (myOutcome == null) { - myOutcome = new StringDt(); - } - return myOutcome; - } - - /** - * Sets the value(s) for outcome (What was result of procedure?) - * - *

- * Definition: - * What was the outcome of the procedure - did it resolve reasons why the procedure was performed? - *

- */ - public Procedure setOutcome(StringDt theValue) { - myOutcome = theValue; - return this; - } - - /** - * Sets the value for outcome (What was result of procedure?) - * - *

- * Definition: - * What was the outcome of the procedure - did it resolve reasons why the procedure was performed? - *

- */ - public Procedure setOutcome( String theString) { - myOutcome = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for report (Any report that results from the procedure). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies - *

- */ - public java.util.List getReport() { - if (myReport == null) { - myReport = new java.util.ArrayList(); - } - return myReport; - } - - /** - * Sets the value(s) for report (Any report that results from the procedure) - * - *

- * Definition: - * This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies - *

- */ - public Procedure setReport(java.util.List theValue) { - myReport = theValue; - return this; - } - - /** - * Adds and returns a new value for report (Any report that results from the procedure) - * - *

- * Definition: - * This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies - *

- */ - public ResourceReferenceDt addReport() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getReport().add(newType); - return newType; - } - - /** - * Gets the value(s) for complication (Complication following the procedure). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Any complications that occurred during the procedure, or in the immediate post-operative period. These are generally tracked separately from the notes, which typically will describe the procedure itself rather than any 'post procedure' issues - *

- */ - public java.util.List getComplication() { - if (myComplication == null) { - myComplication = new java.util.ArrayList(); - } - return myComplication; - } - - /** - * Sets the value(s) for complication (Complication following the procedure) - * - *

- * Definition: - * Any complications that occurred during the procedure, or in the immediate post-operative period. These are generally tracked separately from the notes, which typically will describe the procedure itself rather than any 'post procedure' issues - *

- */ - public Procedure setComplication(java.util.List theValue) { - myComplication = theValue; - return this; - } - - /** - * Adds and returns a new value for complication (Complication following the procedure) - * - *

- * Definition: - * Any complications that occurred during the procedure, or in the immediate post-operative period. These are generally tracked separately from the notes, which typically will describe the procedure itself rather than any 'post procedure' issues - *

- */ - public CodeableConceptDt addComplication() { - CodeableConceptDt newType = new CodeableConceptDt(); - getComplication().add(newType); - return newType; - } - - /** - * Gets the first repetition for complication (Complication following the procedure), - * creating it if it does not already exist. - * - *

- * Definition: - * Any complications that occurred during the procedure, or in the immediate post-operative period. These are generally tracked separately from the notes, which typically will describe the procedure itself rather than any 'post procedure' issues - *

- */ - public CodeableConceptDt getComplicationFirstRep() { - if (getComplication().isEmpty()) { - return addComplication(); - } - return getComplication().get(0); - } - - /** - * Gets the value(s) for followUp (Instructions for follow up). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or potentially could be more complex in which case the CarePlan resource can be used - *

- */ - public StringDt getFollowUp() { - if (myFollowUp == null) { - myFollowUp = new StringDt(); - } - return myFollowUp; - } - - /** - * Sets the value(s) for followUp (Instructions for follow up) - * - *

- * Definition: - * If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or potentially could be more complex in which case the CarePlan resource can be used - *

- */ - public Procedure setFollowUp(StringDt theValue) { - myFollowUp = theValue; - return this; - } - - /** - * Sets the value for followUp (Instructions for follow up) - * - *

- * Definition: - * If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or potentially could be more complex in which case the CarePlan resource can be used - *

- */ - public Procedure setFollowUp( String theString) { - myFollowUp = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for relatedItem (A procedure that is related to this one). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Procedures may be related to other items such as procedures or medications. For example treating wound dehiscence following a previous procedure - *

- */ - public java.util.List getRelatedItem() { - if (myRelatedItem == null) { - myRelatedItem = new java.util.ArrayList(); - } - return myRelatedItem; - } - - /** - * Sets the value(s) for relatedItem (A procedure that is related to this one) - * - *

- * Definition: - * Procedures may be related to other items such as procedures or medications. For example treating wound dehiscence following a previous procedure - *

- */ - public Procedure setRelatedItem(java.util.List theValue) { - myRelatedItem = theValue; - return this; - } - - /** - * Adds and returns a new value for relatedItem (A procedure that is related to this one) - * - *

- * Definition: - * Procedures may be related to other items such as procedures or medications. For example treating wound dehiscence following a previous procedure - *

- */ - public RelatedItem addRelatedItem() { - RelatedItem newType = new RelatedItem(); - getRelatedItem().add(newType); - return newType; - } - - /** - * Gets the first repetition for relatedItem (A procedure that is related to this one), - * creating it if it does not already exist. - * - *

- * Definition: - * Procedures may be related to other items such as procedures or medications. For example treating wound dehiscence following a previous procedure - *

- */ - public RelatedItem getRelatedItemFirstRep() { - if (getRelatedItem().isEmpty()) { - return addRelatedItem(); - } - return getRelatedItem().get(0); - } - - /** - * Gets the value(s) for notes (Additional information about procedure). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Any other notes about the procedure - e.g. the operative notes - *

- */ - public StringDt getNotes() { - if (myNotes == null) { - myNotes = new StringDt(); - } - return myNotes; - } - - /** - * Sets the value(s) for notes (Additional information about procedure) - * - *

- * Definition: - * Any other notes about the procedure - e.g. the operative notes - *

- */ - public Procedure setNotes(StringDt theValue) { - myNotes = theValue; - return this; - } - - /** - * Sets the value for notes (Additional information about procedure) - * - *

- * Definition: - * Any other notes about the procedure - e.g. the operative notes - *

- */ - public Procedure setNotes( String theString) { - myNotes = new StringDt(theString); - return this; - } - - - /** - * Block class for child element: Procedure.performer (The people who performed the procedure) - * - *

- * Definition: - * Limited to 'real' people rather than equipment - *

- */ - @Block() - public static class Performer extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="person", order=0, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class }) - @Description( - shortDefinition="The reference to the practitioner", - formalDefinition="The practitioner who was involved in the procedure" - ) - private ResourceReferenceDt myPerson; - - @Child(name="role", type=CodeableConceptDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="The role the person was in", - formalDefinition="E.g. surgeon, anaethetist, endoscopist" - ) - private CodeableConceptDt myRole; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myPerson, myRole); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myPerson, myRole); - } - - /** - * Gets the value(s) for person (The reference to the practitioner). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The practitioner who was involved in the procedure - *

- */ - public ResourceReferenceDt getPerson() { - if (myPerson == null) { - myPerson = new ResourceReferenceDt(); - } - return myPerson; - } - - /** - * Sets the value(s) for person (The reference to the practitioner) - * - *

- * Definition: - * The practitioner who was involved in the procedure - *

- */ - public Performer setPerson(ResourceReferenceDt theValue) { - myPerson = theValue; - return this; - } - - - /** - * Gets the value(s) for role (The role the person was in). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * E.g. surgeon, anaethetist, endoscopist - *

- */ - public CodeableConceptDt getRole() { - if (myRole == null) { - myRole = new CodeableConceptDt(); - } - return myRole; - } - - /** - * Sets the value(s) for role (The role the person was in) - * - *

- * Definition: - * E.g. surgeon, anaethetist, endoscopist - *

- */ - public Performer setRole(CodeableConceptDt theValue) { - myRole = theValue; - return this; - } - - - - } - - - /** - * Block class for child element: Procedure.relatedItem (A procedure that is related to this one) - * - *

- * Definition: - * Procedures may be related to other items such as procedures or medications. For example treating wound dehiscence following a previous procedure - *

- */ - @Block() - public static class RelatedItem extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="type", type=CodeDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="caused-by | because-of", - formalDefinition="The nature of the relationship" - ) - private BoundCodeDt myType; - - @Child(name="target", order=1, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.AdverseReaction.class, ca.uhn.fhir.model.dstu.resource.AllergyIntolerance.class, ca.uhn.fhir.model.dstu.resource.CarePlan.class, ca.uhn.fhir.model.dstu.resource.Condition.class, ca.uhn.fhir.model.dstu.resource.DeviceObservationReport.class, ca.uhn.fhir.model.dstu.resource.DiagnosticReport.class, ca.uhn.fhir.model.dstu.resource.FamilyHistory.class, ca.uhn.fhir.model.dstu.resource.ImagingStudy.class, ca.uhn.fhir.model.dstu.resource.Immunization.class, ca.uhn.fhir.model.dstu.resource.ImmunizationRecommendation.class, ca.uhn.fhir.model.dstu.resource.MedicationAdministration.class, ca.uhn.fhir.model.dstu.resource.MedicationDispense.class, ca.uhn.fhir.model.dstu.resource.MedicationPrescription.class, ca.uhn.fhir.model.dstu.resource.MedicationStatement.class, ca.uhn.fhir.model.dstu.resource.Observation.class, ca.uhn.fhir.model.dstu.resource.Procedure.class }) - @Description( - shortDefinition="The related item - e.g. a procedure", - formalDefinition="" - ) - private ResourceReferenceDt myTarget; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myType, myTarget); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myType, myTarget); - } - - /** - * Gets the value(s) for type (caused-by | because-of). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The nature of the relationship - *

- */ - public BoundCodeDt getType() { - if (myType == null) { - myType = new BoundCodeDt(ProcedureRelationshipTypeEnum.VALUESET_BINDER); - } - return myType; - } - - /** - * Sets the value(s) for type (caused-by | because-of) - * - *

- * Definition: - * The nature of the relationship - *

- */ - public RelatedItem setType(BoundCodeDt theValue) { - myType = theValue; - return this; - } - - /** - * Sets the value(s) for type (caused-by | because-of) - * - *

- * Definition: - * The nature of the relationship - *

- */ - public RelatedItem setType(ProcedureRelationshipTypeEnum theValue) { - getType().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for target (The related item - e.g. a procedure). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt getTarget() { - if (myTarget == null) { - myTarget = new ResourceReferenceDt(); - } - return myTarget; - } - - /** - * Sets the value(s) for target (The related item - e.g. a procedure) - * - *

- * Definition: - * - *

- */ - public RelatedItem setTarget(ResourceReferenceDt theValue) { - myTarget = theValue; - return this; - } - - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Provenance.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Provenance.java deleted file mode 100644 index c467247aaea..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Provenance.java +++ /dev/null @@ -1,1205 +0,0 @@ - - - - - - - - - - - - - - - - -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.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.ProvenanceEntityRoleEnum; -import ca.uhn.fhir.model.primitive.BoundCodeDt; -import ca.uhn.fhir.model.primitive.CodeDt; -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.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR Provenance Resource - * (Who, What, When for a set of resources) - * - *

- * Definition: - * Provenance information that describes the activity that led to the creation of a set of resources. This information can be used to help determine their reliability or trace where the information in them came from. The focus of the provenance resource is record keeping, audit and traceability, and not explicit statements of clinical significance - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Provenance - *

- * - */ -@ResourceDef(name="Provenance", profile="http://hl7.org/fhir/profiles/Provenance", id="provenance") -public class Provenance extends BaseResource implements IResource { - - /** - * Search parameter constant for target - *

- * Description:
- * Type: reference
- * Path: Provenance.target
- *

- */ - @SearchParamDefinition(name="target", path="Provenance.target", description="", type="reference" ) - public static final String SP_TARGET = "target"; - - /** - * Fluent Client search parameter constant for target - *

- * Description:
- * Type: reference
- * Path: Provenance.target
- *

- */ - public static final ReferenceClientParam TARGET = new ReferenceClientParam(SP_TARGET); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Provenance.target". - */ - public static final Include INCLUDE_TARGET = new Include("Provenance.target"); - - /** - * Search parameter constant for start - *

- * Description:
- * Type: date
- * Path: Provenance.period.start
- *

- */ - @SearchParamDefinition(name="start", path="Provenance.period.start", description="", type="date" ) - public static final String SP_START = "start"; - - /** - * Fluent Client search parameter constant for start - *

- * Description:
- * Type: date
- * Path: Provenance.period.start
- *

- */ - public static final DateClientParam START = new DateClientParam(SP_START); - - /** - * Search parameter constant for end - *

- * Description:
- * Type: date
- * Path: Provenance.period.end
- *

- */ - @SearchParamDefinition(name="end", path="Provenance.period.end", description="", type="date" ) - public static final String SP_END = "end"; - - /** - * Fluent Client search parameter constant for end - *

- * Description:
- * Type: date
- * Path: Provenance.period.end
- *

- */ - public static final DateClientParam END = new DateClientParam(SP_END); - - /** - * Search parameter constant for location - *

- * Description:
- * Type: reference
- * Path: Provenance.location
- *

- */ - @SearchParamDefinition(name="location", path="Provenance.location", description="", type="reference" ) - public static final String SP_LOCATION = "location"; - - /** - * Fluent Client search parameter constant for location - *

- * Description:
- * Type: reference
- * Path: Provenance.location
- *

- */ - public static final ReferenceClientParam LOCATION = new ReferenceClientParam(SP_LOCATION); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Provenance.location". - */ - public static final Include INCLUDE_LOCATION = new Include("Provenance.location"); - - /** - * Search parameter constant for party - *

- * Description:
- * Type: token
- * Path: Provenance.agent.reference
- *

- */ - @SearchParamDefinition(name="party", path="Provenance.agent.reference", description="", type="token" ) - public static final String SP_PARTY = "party"; - - /** - * Fluent Client search parameter constant for party - *

- * Description:
- * Type: token
- * Path: Provenance.agent.reference
- *

- */ - public static final TokenClientParam PARTY = new TokenClientParam(SP_PARTY); - - /** - * Search parameter constant for partytype - *

- * Description:
- * Type: token
- * Path: Provenance.agent.type
- *

- */ - @SearchParamDefinition(name="partytype", path="Provenance.agent.type", description="", type="token" ) - public static final String SP_PARTYTYPE = "partytype"; - - /** - * Fluent Client search parameter constant for partytype - *

- * Description:
- * Type: token
- * Path: Provenance.agent.type
- *

- */ - public static final TokenClientParam PARTYTYPE = new TokenClientParam(SP_PARTYTYPE); - - - @Child(name="target", order=0, min=1, max=Child.MAX_UNLIMITED, type={ - IResource.class }) - @Description( - shortDefinition="Target resource(s) (usually version specific)", - formalDefinition="The resource(s) that were generated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity" - ) - private java.util.List myTarget; - - @Child(name="period", type=PeriodDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="When the activity occurred", - formalDefinition="The period during which the activity occurred" - ) - private PeriodDt myPeriod; - - @Child(name="recorded", type=InstantDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="When the activity was recorded / updated", - formalDefinition="The instant of time at which the activity was recorded" - ) - private InstantDt myRecorded; - - @Child(name="reason", type=CodeableConceptDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Reason the activity is occurring", - formalDefinition="The reason that the activity was taking place" - ) - private CodeableConceptDt myReason; - - @Child(name="location", order=4, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Location.class }) - @Description( - shortDefinition="Where the activity occurred, if relevant", - formalDefinition="Where the activity occurred, if relevant" - ) - private ResourceReferenceDt myLocation; - - @Child(name="policy", type=UriDt.class, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Policy or plan the activity was defined by", - formalDefinition="Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc." - ) - private java.util.List myPolicy; - - @Child(name="agent", order=6, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Person, organization, records, etc. involved in creating resource", - formalDefinition="An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, a piece of software, an inanimate object, an organization, or other entities that may be ascribed responsibility" - ) - private java.util.List myAgent; - - @Child(name="entity", order=7, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="An entity used in this activity", - formalDefinition="An entity used in this activity" - ) - private java.util.List myEntity; - - @Child(name="integritySignature", type=StringDt.class, order=8, min=0, max=1) - @Description( - shortDefinition="Base64 signature (DigSig) - integrity check", - formalDefinition="A digital signature on the target resource(s). The signature should match a Provenance.agent.reference in the provenance resource. The signature is only added to support checking cryptographic integrity of the resource, and not to represent workflow and clinical aspects of the signing process, or to support non-repudiation." - ) - private StringDt myIntegritySignature; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myTarget, myPeriod, myRecorded, myReason, myLocation, myPolicy, myAgent, myEntity, myIntegritySignature); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myTarget, myPeriod, myRecorded, myReason, myLocation, myPolicy, myAgent, myEntity, myIntegritySignature); - } - - /** - * Gets the value(s) for target (Target resource(s) (usually version specific)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The resource(s) that were generated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity - *

- */ - public java.util.List getTarget() { - if (myTarget == null) { - myTarget = new java.util.ArrayList(); - } - return myTarget; - } - - /** - * Sets the value(s) for target (Target resource(s) (usually version specific)) - * - *

- * Definition: - * The resource(s) that were generated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity - *

- */ - public Provenance setTarget(java.util.List theValue) { - myTarget = theValue; - return this; - } - - /** - * Adds and returns a new value for target (Target resource(s) (usually version specific)) - * - *

- * Definition: - * The resource(s) that were generated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity - *

- */ - public ResourceReferenceDt addTarget() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getTarget().add(newType); - return newType; - } - - /** - * Gets the value(s) for period (When the activity occurred). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The period during which the activity occurred - *

- */ - public PeriodDt getPeriod() { - if (myPeriod == null) { - myPeriod = new PeriodDt(); - } - return myPeriod; - } - - /** - * Sets the value(s) for period (When the activity occurred) - * - *

- * Definition: - * The period during which the activity occurred - *

- */ - public Provenance setPeriod(PeriodDt theValue) { - myPeriod = theValue; - return this; - } - - - /** - * Gets the value(s) for recorded (When the activity was recorded / updated). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The instant of time at which the activity was recorded - *

- */ - public InstantDt getRecorded() { - if (myRecorded == null) { - myRecorded = new InstantDt(); - } - return myRecorded; - } - - /** - * Sets the value(s) for recorded (When the activity was recorded / updated) - * - *

- * Definition: - * The instant of time at which the activity was recorded - *

- */ - public Provenance setRecorded(InstantDt theValue) { - myRecorded = theValue; - return this; - } - - /** - * Sets the value for recorded (When the activity was recorded / updated) - * - *

- * Definition: - * The instant of time at which the activity was recorded - *

- */ - public Provenance setRecorded( Date theDate, TemporalPrecisionEnum thePrecision) { - myRecorded = new InstantDt(theDate, thePrecision); - return this; - } - - /** - * Sets the value for recorded (When the activity was recorded / updated) - * - *

- * Definition: - * The instant of time at which the activity was recorded - *

- */ - public Provenance setRecordedWithMillisPrecision( Date theDate) { - myRecorded = new InstantDt(theDate); - return this; - } - - - /** - * Gets the value(s) for reason (Reason the activity is occurring). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The reason that the activity was taking place - *

- */ - public CodeableConceptDt getReason() { - if (myReason == null) { - myReason = new CodeableConceptDt(); - } - return myReason; - } - - /** - * Sets the value(s) for reason (Reason the activity is occurring) - * - *

- * Definition: - * The reason that the activity was taking place - *

- */ - public Provenance setReason(CodeableConceptDt theValue) { - myReason = theValue; - return this; - } - - - /** - * Gets the value(s) for location (Where the activity occurred, if relevant). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Where the activity occurred, if relevant - *

- */ - public ResourceReferenceDt getLocation() { - if (myLocation == null) { - myLocation = new ResourceReferenceDt(); - } - return myLocation; - } - - /** - * Sets the value(s) for location (Where the activity occurred, if relevant) - * - *

- * Definition: - * Where the activity occurred, if relevant - *

- */ - public Provenance setLocation(ResourceReferenceDt theValue) { - myLocation = theValue; - return this; - } - - - /** - * Gets the value(s) for policy (Policy or plan the activity was defined by). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc. - *

- */ - public java.util.List getPolicy() { - if (myPolicy == null) { - myPolicy = new java.util.ArrayList(); - } - return myPolicy; - } - - /** - * Sets the value(s) for policy (Policy or plan the activity was defined by) - * - *

- * Definition: - * Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc. - *

- */ - public Provenance setPolicy(java.util.List theValue) { - myPolicy = theValue; - return this; - } - - /** - * Adds and returns a new value for policy (Policy or plan the activity was defined by) - * - *

- * Definition: - * Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc. - *

- */ - public UriDt addPolicy() { - UriDt newType = new UriDt(); - getPolicy().add(newType); - return newType; - } - - /** - * Gets the first repetition for policy (Policy or plan the activity was defined by), - * creating it if it does not already exist. - * - *

- * Definition: - * Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc. - *

- */ - public UriDt getPolicyFirstRep() { - if (getPolicy().isEmpty()) { - return addPolicy(); - } - return getPolicy().get(0); - } - /** - * Adds a new value for policy (Policy or plan the activity was defined by) - * - *

- * Definition: - * Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc. - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Provenance addPolicy( String theUri) { - if (myPolicy == null) { - myPolicy = new java.util.ArrayList(); - } - myPolicy.add(new UriDt(theUri)); - return this; - } - - - /** - * Gets the value(s) for agent (Person, organization, records, etc. involved in creating resource). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, a piece of software, an inanimate object, an organization, or other entities that may be ascribed responsibility - *

- */ - public java.util.List getAgent() { - if (myAgent == null) { - myAgent = new java.util.ArrayList(); - } - return myAgent; - } - - /** - * Sets the value(s) for agent (Person, organization, records, etc. involved in creating resource) - * - *

- * Definition: - * An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, a piece of software, an inanimate object, an organization, or other entities that may be ascribed responsibility - *

- */ - public Provenance setAgent(java.util.List theValue) { - myAgent = theValue; - return this; - } - - /** - * Adds and returns a new value for agent (Person, organization, records, etc. involved in creating resource) - * - *

- * Definition: - * An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, a piece of software, an inanimate object, an organization, or other entities that may be ascribed responsibility - *

- */ - public Agent addAgent() { - Agent newType = new Agent(); - getAgent().add(newType); - return newType; - } - - /** - * Gets the first repetition for agent (Person, organization, records, etc. involved in creating resource), - * creating it if it does not already exist. - * - *

- * Definition: - * An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, a piece of software, an inanimate object, an organization, or other entities that may be ascribed responsibility - *

- */ - public Agent getAgentFirstRep() { - if (getAgent().isEmpty()) { - return addAgent(); - } - return getAgent().get(0); - } - - /** - * Gets the value(s) for entity (An entity used in this activity). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * An entity used in this activity - *

- */ - public java.util.List getEntity() { - if (myEntity == null) { - myEntity = new java.util.ArrayList(); - } - return myEntity; - } - - /** - * Sets the value(s) for entity (An entity used in this activity) - * - *

- * Definition: - * An entity used in this activity - *

- */ - public Provenance setEntity(java.util.List theValue) { - myEntity = theValue; - return this; - } - - /** - * Adds and returns a new value for entity (An entity used in this activity) - * - *

- * Definition: - * An entity used in this activity - *

- */ - public Entity addEntity() { - Entity newType = new Entity(); - getEntity().add(newType); - return newType; - } - - /** - * Gets the first repetition for entity (An entity used in this activity), - * creating it if it does not already exist. - * - *

- * Definition: - * An entity used in this activity - *

- */ - public Entity getEntityFirstRep() { - if (getEntity().isEmpty()) { - return addEntity(); - } - return getEntity().get(0); - } - - /** - * Gets the value(s) for integritySignature (Base64 signature (DigSig) - integrity check). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A digital signature on the target resource(s). The signature should match a Provenance.agent.reference in the provenance resource. The signature is only added to support checking cryptographic integrity of the resource, and not to represent workflow and clinical aspects of the signing process, or to support non-repudiation. - *

- */ - public StringDt getIntegritySignature() { - if (myIntegritySignature == null) { - myIntegritySignature = new StringDt(); - } - return myIntegritySignature; - } - - /** - * Sets the value(s) for integritySignature (Base64 signature (DigSig) - integrity check) - * - *

- * Definition: - * A digital signature on the target resource(s). The signature should match a Provenance.agent.reference in the provenance resource. The signature is only added to support checking cryptographic integrity of the resource, and not to represent workflow and clinical aspects of the signing process, or to support non-repudiation. - *

- */ - public Provenance setIntegritySignature(StringDt theValue) { - myIntegritySignature = theValue; - return this; - } - - /** - * Sets the value for integritySignature (Base64 signature (DigSig) - integrity check) - * - *

- * Definition: - * A digital signature on the target resource(s). The signature should match a Provenance.agent.reference in the provenance resource. The signature is only added to support checking cryptographic integrity of the resource, and not to represent workflow and clinical aspects of the signing process, or to support non-repudiation. - *

- */ - public Provenance setIntegritySignature( String theString) { - myIntegritySignature = new StringDt(theString); - return this; - } - - - /** - * Block class for child element: Provenance.agent (Person, organization, records, etc. involved in creating resource) - * - *

- * Definition: - * An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, a piece of software, an inanimate object, an organization, or other entities that may be ascribed responsibility - *

- */ - @Block() - public static class Agent extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="role", type=CodingDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="e.g. author | overseer | enterer | attester | source | cc: +", - formalDefinition="The role that the participant played" - ) - private CodingDt myRole; - - @Child(name="type", type=CodingDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="e.g. Resource | Person | Application | Record | Document +", - formalDefinition="The type of the participant" - ) - private CodingDt myType; - - @Child(name="reference", type=UriDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="Identity of agent (urn or url)", - formalDefinition="Identity of participant. May be a logical or physical uri and maybe absolute or relative" - ) - private UriDt myReference; - - @Child(name="display", type=StringDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Human description of participant", - formalDefinition="Human-readable description of the participant" - ) - private StringDt myDisplay; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myRole, myType, myReference, myDisplay); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myRole, myType, myReference, myDisplay); - } - - /** - * Gets the value(s) for role (e.g. author | overseer | enterer | attester | source | cc: +). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The role that the participant played - *

- */ - public CodingDt getRole() { - if (myRole == null) { - myRole = new CodingDt(); - } - return myRole; - } - - /** - * Sets the value(s) for role (e.g. author | overseer | enterer | attester | source | cc: +) - * - *

- * Definition: - * The role that the participant played - *

- */ - public Agent setRole(CodingDt theValue) { - myRole = theValue; - return this; - } - - - /** - * Gets the value(s) for type (e.g. Resource | Person | Application | Record | Document +). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The type of the participant - *

- */ - public CodingDt getType() { - if (myType == null) { - myType = new CodingDt(); - } - return myType; - } - - /** - * Sets the value(s) for type (e.g. Resource | Person | Application | Record | Document +) - * - *

- * Definition: - * The type of the participant - *

- */ - public Agent setType(CodingDt theValue) { - myType = theValue; - return this; - } - - - /** - * Gets the value(s) for reference (Identity of agent (urn or url)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identity of participant. May be a logical or physical uri and maybe absolute or relative - *

- */ - public UriDt getReference() { - if (myReference == null) { - myReference = new UriDt(); - } - return myReference; - } - - /** - * Sets the value(s) for reference (Identity of agent (urn or url)) - * - *

- * Definition: - * Identity of participant. May be a logical or physical uri and maybe absolute or relative - *

- */ - public Agent setReference(UriDt theValue) { - myReference = theValue; - return this; - } - - /** - * Sets the value for reference (Identity of agent (urn or url)) - * - *

- * Definition: - * Identity of participant. May be a logical or physical uri and maybe absolute or relative - *

- */ - public Agent setReference( String theUri) { - myReference = new UriDt(theUri); - return this; - } - - - /** - * Gets the value(s) for display (Human description of participant). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Human-readable description of the participant - *

- */ - public StringDt getDisplay() { - if (myDisplay == null) { - myDisplay = new StringDt(); - } - return myDisplay; - } - - /** - * Sets the value(s) for display (Human description of participant) - * - *

- * Definition: - * Human-readable description of the participant - *

- */ - public Agent setDisplay(StringDt theValue) { - myDisplay = theValue; - return this; - } - - /** - * Sets the value for display (Human description of participant) - * - *

- * Definition: - * Human-readable description of the participant - *

- */ - public Agent setDisplay( String theString) { - myDisplay = new StringDt(theString); - return this; - } - - - - } - - - /** - * Block class for child element: Provenance.entity (An entity used in this activity) - * - *

- * Definition: - * An entity used in this activity - *

- */ - @Block() - public static class Entity extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="role", type=CodeDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="derivation | revision | quotation | source", - formalDefinition="How the entity was used during the activity" - ) - private BoundCodeDt myRole; - - @Child(name="type", type=CodingDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="Resource Type, or something else", - formalDefinition="The type of the entity. If the entity is a resource, then this is a resource type" - ) - private CodingDt myType; - - @Child(name="reference", type=UriDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="Identity of participant (urn or url)", - formalDefinition="Identity of participant. May be a logical or physical uri and maybe absolute or relative" - ) - private UriDt myReference; - - @Child(name="display", type=StringDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Human description of participant", - formalDefinition="Human-readable description of the entity" - ) - private StringDt myDisplay; - - @Child(name="agent", type=Agent.class, order=4, min=0, max=1) - @Description( - shortDefinition="Entity is attributed to this agent", - formalDefinition="The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity" - ) - private Agent myAgent; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myRole, myType, myReference, myDisplay, myAgent); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myRole, myType, myReference, myDisplay, myAgent); - } - - /** - * Gets the value(s) for role (derivation | revision | quotation | source). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * How the entity was used during the activity - *

- */ - public BoundCodeDt getRole() { - if (myRole == null) { - myRole = new BoundCodeDt(ProvenanceEntityRoleEnum.VALUESET_BINDER); - } - return myRole; - } - - /** - * Sets the value(s) for role (derivation | revision | quotation | source) - * - *

- * Definition: - * How the entity was used during the activity - *

- */ - public Entity setRole(BoundCodeDt theValue) { - myRole = theValue; - return this; - } - - /** - * Sets the value(s) for role (derivation | revision | quotation | source) - * - *

- * Definition: - * How the entity was used during the activity - *

- */ - public Entity setRole(ProvenanceEntityRoleEnum theValue) { - getRole().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for type (Resource Type, or something else). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The type of the entity. If the entity is a resource, then this is a resource type - *

- */ - public CodingDt getType() { - if (myType == null) { - myType = new CodingDt(); - } - return myType; - } - - /** - * Sets the value(s) for type (Resource Type, or something else) - * - *

- * Definition: - * The type of the entity. If the entity is a resource, then this is a resource type - *

- */ - public Entity setType(CodingDt theValue) { - myType = theValue; - return this; - } - - - /** - * Gets the value(s) for reference (Identity of participant (urn or url)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identity of participant. May be a logical or physical uri and maybe absolute or relative - *

- */ - public UriDt getReference() { - if (myReference == null) { - myReference = new UriDt(); - } - return myReference; - } - - /** - * Sets the value(s) for reference (Identity of participant (urn or url)) - * - *

- * Definition: - * Identity of participant. May be a logical or physical uri and maybe absolute or relative - *

- */ - public Entity setReference(UriDt theValue) { - myReference = theValue; - return this; - } - - /** - * Sets the value for reference (Identity of participant (urn or url)) - * - *

- * Definition: - * Identity of participant. May be a logical or physical uri and maybe absolute or relative - *

- */ - public Entity setReference( String theUri) { - myReference = new UriDt(theUri); - return this; - } - - - /** - * Gets the value(s) for display (Human description of participant). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Human-readable description of the entity - *

- */ - public StringDt getDisplay() { - if (myDisplay == null) { - myDisplay = new StringDt(); - } - return myDisplay; - } - - /** - * Sets the value(s) for display (Human description of participant) - * - *

- * Definition: - * Human-readable description of the entity - *

- */ - public Entity setDisplay(StringDt theValue) { - myDisplay = theValue; - return this; - } - - /** - * Sets the value for display (Human description of participant) - * - *

- * Definition: - * Human-readable description of the entity - *

- */ - public Entity setDisplay( String theString) { - myDisplay = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for agent (Entity is attributed to this agent). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity - *

- */ - public Agent getAgent() { - if (myAgent == null) { - myAgent = new Agent(); - } - return myAgent; - } - - /** - * Sets the value(s) for agent (Entity is attributed to this agent) - * - *

- * Definition: - * The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity - *

- */ - public Entity setAgent(Agent theValue) { - myAgent = theValue; - return this; - } - - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Query.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Query.java deleted file mode 100644 index 01e41b02419..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Query.java +++ /dev/null @@ -1,863 +0,0 @@ - - - - - - - - - - - - - - - - -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.List; - -import ca.uhn.fhir.model.api.BaseIdentifiableElement; -import ca.uhn.fhir.model.api.BaseResource; -import ca.uhn.fhir.model.api.ExtensionDt; -import ca.uhn.fhir.model.api.IElement; -import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.api.IResourceBlock; -import ca.uhn.fhir.model.api.annotation.Block; -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.Description; -import ca.uhn.fhir.model.api.annotation.ResourceDef; -import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.QueryOutcomeEnum; -import ca.uhn.fhir.model.primitive.BoundCodeDt; -import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.UriDt; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR Query Resource - * (A description of a query with a set of parameters) - * - *

- * Definition: - * - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Query - *

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

- * Description:
- * Type: token
- * Path: Query.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Query.identifier", description="", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - - /** - * Fluent Client search parameter constant for identifier - *

- * Description:
- * Type: token
- * Path: Query.identifier
- *

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

- * Description:
- * Type: token
- * Path: Query.response.identifier
- *

- */ - @SearchParamDefinition(name="response", path="Query.response.identifier", description="", type="token" ) - public static final String SP_RESPONSE = "response"; - - /** - * Fluent Client search parameter constant for response - *

- * Description:
- * Type: token
- * Path: Query.response.identifier
- *

- */ - public static final TokenClientParam RESPONSE = new TokenClientParam(SP_RESPONSE); - - - @Child(name="identifier", type=UriDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Links query and its response(s)", - formalDefinition="" - ) - private UriDt myIdentifier; - - @Child(name="parameter", type=ExtensionDt.class, order=1, min=1, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Set of query parameters with values", - formalDefinition="" - ) - private java.util.List myParameter; - - @Child(name="response", order=2, min=0, max=1) - @Description( - shortDefinition="If this is a response to a query", - formalDefinition="" - ) - private Response myResponse; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myParameter, myResponse); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myParameter, myResponse); - } - - /** - * Gets the value(s) for identifier (Links query and its response(s)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public UriDt getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new UriDt(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Links query and its response(s)) - * - *

- * Definition: - * - *

- */ - public Query setIdentifier(UriDt theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Sets the value for identifier (Links query and its response(s)) - * - *

- * Definition: - * - *

- */ - public Query setIdentifier( String theUri) { - myIdentifier = new UriDt(theUri); - return this; - } - - - /** - * Gets the value(s) for parameter (Set of query parameters with values). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getParameter() { - if (myParameter == null) { - myParameter = new java.util.ArrayList(); - } - return myParameter; - } - - /** - * Sets the value(s) for parameter (Set of query parameters with values) - * - *

- * Definition: - * - *

- */ - public Query setParameter(java.util.List theValue) { - myParameter = theValue; - return this; - } - - /** - * Adds and returns a new value for parameter (Set of query parameters with values) - * - *

- * Definition: - * - *

- */ - public ExtensionDt addParameter() { - ExtensionDt newType = new ExtensionDt(); - getParameter().add(newType); - return newType; - } - - /** - * Gets the first repetition for parameter (Set of query parameters with values), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public ExtensionDt getParameterFirstRep() { - if (getParameter().isEmpty()) { - return addParameter(); - } - return getParameter().get(0); - } - - /** - * Gets the value(s) for response (If this is a response to a query). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public Response getResponse() { - if (myResponse == null) { - myResponse = new Response(); - } - return myResponse; - } - - /** - * Sets the value(s) for response (If this is a response to a query) - * - *

- * Definition: - * - *

- */ - public Query setResponse(Response theValue) { - myResponse = theValue; - return this; - } - - - /** - * Block class for child element: Query.response (If this is a response to a query) - * - *

- * Definition: - * - *

- */ - @Block() - public static class Response extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="identifier", type=UriDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Links response to source query", - formalDefinition="" - ) - private UriDt myIdentifier; - - @Child(name="outcome", type=CodeDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="ok | limited | refused | error", - formalDefinition="Outcome of processing the query" - ) - private BoundCodeDt myOutcome; - - @Child(name="total", type=IntegerDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Total number of matching records", - formalDefinition="" - ) - private IntegerDt myTotal; - - @Child(name="parameter", type=ExtensionDt.class, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Parameters server used", - formalDefinition="" - ) - private java.util.List myParameter; - - @Child(name="first", type=ExtensionDt.class, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="To get first page (if paged)", - formalDefinition="" - ) - private java.util.List myFirst; - - @Child(name="previous", type=ExtensionDt.class, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="To get previous page (if paged)", - formalDefinition="" - ) - private java.util.List myPrevious; - - @Child(name="next", type=ExtensionDt.class, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="To get next page (if paged)", - formalDefinition="" - ) - private java.util.List myNext; - - @Child(name="last", type=ExtensionDt.class, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="To get last page (if paged)", - formalDefinition="" - ) - private java.util.List myLast; - - @Child(name="reference", order=8, min=0, max=Child.MAX_UNLIMITED, type={ - IResource.class }) - @Description( - shortDefinition="Resources that are the results of the search", - formalDefinition="" - ) - private java.util.List myReference; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myOutcome, myTotal, myParameter, myFirst, myPrevious, myNext, myLast, myReference); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myOutcome, myTotal, myParameter, myFirst, myPrevious, myNext, myLast, myReference); - } - - /** - * Gets the value(s) for identifier (Links response to source query). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public UriDt getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new UriDt(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Links response to source query) - * - *

- * Definition: - * - *

- */ - public Response setIdentifier(UriDt theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Sets the value for identifier (Links response to source query) - * - *

- * Definition: - * - *

- */ - public Response setIdentifier( String theUri) { - myIdentifier = new UriDt(theUri); - return this; - } - - - /** - * Gets the value(s) for outcome (ok | limited | refused | error). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Outcome of processing the query - *

- */ - public BoundCodeDt getOutcome() { - if (myOutcome == null) { - myOutcome = new BoundCodeDt(QueryOutcomeEnum.VALUESET_BINDER); - } - return myOutcome; - } - - /** - * Sets the value(s) for outcome (ok | limited | refused | error) - * - *

- * Definition: - * Outcome of processing the query - *

- */ - public Response setOutcome(BoundCodeDt theValue) { - myOutcome = theValue; - return this; - } - - /** - * Sets the value(s) for outcome (ok | limited | refused | error) - * - *

- * Definition: - * Outcome of processing the query - *

- */ - public Response setOutcome(QueryOutcomeEnum theValue) { - getOutcome().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for total (Total number of matching records). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public IntegerDt getTotal() { - if (myTotal == null) { - myTotal = new IntegerDt(); - } - return myTotal; - } - - /** - * Sets the value(s) for total (Total number of matching records) - * - *

- * Definition: - * - *

- */ - public Response setTotal(IntegerDt theValue) { - myTotal = theValue; - return this; - } - - /** - * Sets the value for total (Total number of matching records) - * - *

- * Definition: - * - *

- */ - public Response setTotal( int theInteger) { - myTotal = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for parameter (Parameters server used). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getParameter() { - if (myParameter == null) { - myParameter = new java.util.ArrayList(); - } - return myParameter; - } - - /** - * Sets the value(s) for parameter (Parameters server used) - * - *

- * Definition: - * - *

- */ - public Response setParameter(java.util.List theValue) { - myParameter = theValue; - return this; - } - - /** - * Adds and returns a new value for parameter (Parameters server used) - * - *

- * Definition: - * - *

- */ - public ExtensionDt addParameter() { - ExtensionDt newType = new ExtensionDt(); - getParameter().add(newType); - return newType; - } - - /** - * Gets the first repetition for parameter (Parameters server used), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public ExtensionDt getParameterFirstRep() { - if (getParameter().isEmpty()) { - return addParameter(); - } - return getParameter().get(0); - } - - /** - * Gets the value(s) for first (To get first page (if paged)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getFirst() { - if (myFirst == null) { - myFirst = new java.util.ArrayList(); - } - return myFirst; - } - - /** - * Sets the value(s) for first (To get first page (if paged)) - * - *

- * Definition: - * - *

- */ - public Response setFirst(java.util.List theValue) { - myFirst = theValue; - return this; - } - - /** - * Adds and returns a new value for first (To get first page (if paged)) - * - *

- * Definition: - * - *

- */ - public ExtensionDt addFirst() { - ExtensionDt newType = new ExtensionDt(); - getFirst().add(newType); - return newType; - } - - /** - * Gets the first repetition for first (To get first page (if paged)), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public ExtensionDt getFirstFirstRep() { - if (getFirst().isEmpty()) { - return addFirst(); - } - return getFirst().get(0); - } - - /** - * Gets the value(s) for previous (To get previous page (if paged)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getPrevious() { - if (myPrevious == null) { - myPrevious = new java.util.ArrayList(); - } - return myPrevious; - } - - /** - * Sets the value(s) for previous (To get previous page (if paged)) - * - *

- * Definition: - * - *

- */ - public Response setPrevious(java.util.List theValue) { - myPrevious = theValue; - return this; - } - - /** - * Adds and returns a new value for previous (To get previous page (if paged)) - * - *

- * Definition: - * - *

- */ - public ExtensionDt addPrevious() { - ExtensionDt newType = new ExtensionDt(); - getPrevious().add(newType); - return newType; - } - - /** - * Gets the first repetition for previous (To get previous page (if paged)), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public ExtensionDt getPreviousFirstRep() { - if (getPrevious().isEmpty()) { - return addPrevious(); - } - return getPrevious().get(0); - } - - /** - * Gets the value(s) for next (To get next page (if paged)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getNext() { - if (myNext == null) { - myNext = new java.util.ArrayList(); - } - return myNext; - } - - /** - * Sets the value(s) for next (To get next page (if paged)) - * - *

- * Definition: - * - *

- */ - public Response setNext(java.util.List theValue) { - myNext = theValue; - return this; - } - - /** - * Adds and returns a new value for next (To get next page (if paged)) - * - *

- * Definition: - * - *

- */ - public ExtensionDt addNext() { - ExtensionDt newType = new ExtensionDt(); - getNext().add(newType); - return newType; - } - - /** - * Gets the first repetition for next (To get next page (if paged)), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public ExtensionDt getNextFirstRep() { - if (getNext().isEmpty()) { - return addNext(); - } - return getNext().get(0); - } - - /** - * Gets the value(s) for last (To get last page (if paged)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getLast() { - if (myLast == null) { - myLast = new java.util.ArrayList(); - } - return myLast; - } - - /** - * Sets the value(s) for last (To get last page (if paged)) - * - *

- * Definition: - * - *

- */ - public Response setLast(java.util.List theValue) { - myLast = theValue; - return this; - } - - /** - * Adds and returns a new value for last (To get last page (if paged)) - * - *

- * Definition: - * - *

- */ - public ExtensionDt addLast() { - ExtensionDt newType = new ExtensionDt(); - getLast().add(newType); - return newType; - } - - /** - * Gets the first repetition for last (To get last page (if paged)), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public ExtensionDt getLastFirstRep() { - if (getLast().isEmpty()) { - return addLast(); - } - return getLast().get(0); - } - - /** - * Gets the value(s) for reference (Resources that are the results of the search). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getReference() { - if (myReference == null) { - myReference = new java.util.ArrayList(); - } - return myReference; - } - - /** - * Sets the value(s) for reference (Resources that are the results of the search) - * - *

- * Definition: - * - *

- */ - public Response setReference(java.util.List theValue) { - myReference = theValue; - return this; - } - - /** - * Adds and returns a new value for reference (Resources that are the results of the search) - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt addReference() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getReference().add(newType); - return newType; - } - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Questionnaire.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Questionnaire.java deleted file mode 100644 index 667f08dc289..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Questionnaire.java +++ /dev/null @@ -1,1506 +0,0 @@ - - - - - - - - - - - - - - - - -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.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.QuestionnaireGroupNameEnum; -import ca.uhn.fhir.model.dstu.valueset.QuestionnaireNameEnum; -import ca.uhn.fhir.model.dstu.valueset.QuestionnaireStatusEnum; -import ca.uhn.fhir.model.primitive.BooleanDt; -import ca.uhn.fhir.model.primitive.BoundCodeDt; -import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; -import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.DateDt; -import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.model.primitive.DecimalDt; -import ca.uhn.fhir.model.primitive.InstantDt; -import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.rest.gclient.DateClientParam; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR Questionnaire Resource - * (A structured set of questions and their answers) - * - *

- * Definition: - * A structured set of questions and their answers. The Questionnaire may contain questions, answers or both. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions - *

- * - *

- * Requirements: - * To support structured, hierarchical registration of data gathered using digital forms and other questionnaires. - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Questionnaire - *

- * - */ -@ResourceDef(name="Questionnaire", profile="http://hl7.org/fhir/profiles/Questionnaire", id="questionnaire") -public class Questionnaire extends BaseResource implements IResource { - - /** - * Search parameter constant for status - *

- * Description: The status of the questionnaire
- * Type: token
- * Path: Questionnaire.status
- *

- */ - @SearchParamDefinition(name="status", path="Questionnaire.status", description="The status of the questionnaire", type="token" ) - public static final String SP_STATUS = "status"; - - /** - * Fluent Client search parameter constant for status - *

- * Description: The status of the questionnaire
- * Type: token
- * Path: Questionnaire.status
- *

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

- * Description: When the questionnaire was authored
- * Type: date
- * Path: Questionnaire.authored
- *

- */ - @SearchParamDefinition(name="authored", path="Questionnaire.authored", description="When the questionnaire was authored", type="date" ) - public static final String SP_AUTHORED = "authored"; - - /** - * Fluent Client search parameter constant for authored - *

- * Description: When the questionnaire was authored
- * Type: date
- * Path: Questionnaire.authored
- *

- */ - public static final DateClientParam AUTHORED = new DateClientParam(SP_AUTHORED); - - /** - * Search parameter constant for subject - *

- * Description: The subject of the questionnaire
- * Type: reference
- * Path: Questionnaire.subject
- *

- */ - @SearchParamDefinition(name="subject", path="Questionnaire.subject", description="The subject of the questionnaire", type="reference" ) - public static final String SP_SUBJECT = "subject"; - - /** - * Fluent Client search parameter constant for subject - *

- * Description: The subject of the questionnaire
- * Type: reference
- * Path: Questionnaire.subject
- *

- */ - public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Questionnaire.subject". - */ - public static final Include INCLUDE_SUBJECT = new Include("Questionnaire.subject"); - - /** - * Search parameter constant for author - *

- * Description: The author of the questionnaire
- * Type: reference
- * Path: Questionnaire.author
- *

- */ - @SearchParamDefinition(name="author", path="Questionnaire.author", description="The author of the questionnaire", type="reference" ) - public static final String SP_AUTHOR = "author"; - - /** - * Fluent Client search parameter constant for author - *

- * Description: The author of the questionnaire
- * Type: reference
- * Path: Questionnaire.author
- *

- */ - public static final ReferenceClientParam AUTHOR = new ReferenceClientParam(SP_AUTHOR); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Questionnaire.author". - */ - public static final Include INCLUDE_AUTHOR = new Include("Questionnaire.author"); - - /** - * Search parameter constant for identifier - *

- * Description: An identifier for the questionnaire
- * Type: token
- * Path: Questionnaire.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Questionnaire.identifier", description="An identifier for the questionnaire", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - - /** - * Fluent Client search parameter constant for identifier - *

- * Description: An identifier for the questionnaire
- * Type: token
- * Path: Questionnaire.identifier
- *

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

- * Description: Name of the questionnaire
- * Type: token
- * Path: Questionnaire.name
- *

- */ - @SearchParamDefinition(name="name", path="Questionnaire.name", description="Name of the questionnaire", type="token" ) - public static final String SP_NAME = "name"; - - /** - * Fluent Client search parameter constant for name - *

- * Description: Name of the questionnaire
- * Type: token
- * Path: Questionnaire.name
- *

- */ - public static final TokenClientParam NAME = new TokenClientParam(SP_NAME); - - /** - * Search parameter constant for encounter - *

- * Description: Encounter during which questionnaire was authored
- * Type: reference
- * Path: Questionnaire.encounter
- *

- */ - @SearchParamDefinition(name="encounter", path="Questionnaire.encounter", description="Encounter during which questionnaire was authored", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - - /** - * Fluent Client search parameter constant for encounter - *

- * Description: Encounter during which questionnaire was authored
- * Type: reference
- * Path: Questionnaire.encounter
- *

- */ - public static final ReferenceClientParam ENCOUNTER = new ReferenceClientParam(SP_ENCOUNTER); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Questionnaire.encounter". - */ - public static final Include INCLUDE_ENCOUNTER = new Include("Questionnaire.encounter"); - - - @Child(name="status", type=CodeDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="draft | published | retired | in progress | completed | amended", - formalDefinition="The lifecycle status of the questionnaire as a whole." - ) - private BoundCodeDt myStatus; - - @Child(name="authored", type=DateTimeDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="Date this version was authored", - formalDefinition="The date and/or time that this version of the questionnaire was authored" - ) - private DateTimeDt myAuthored; - - @Child(name="subject", order=2, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.RelatedPerson.class }) - @Description( - shortDefinition="The subject of the questions", - formalDefinition="The subject of the questionnaires: this is the patient that the answers apply to, but this person is not necessarily the source of information" - ) - private ResourceReferenceDt mySubject; - - @Child(name="author", order=3, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.RelatedPerson.class }) - @Description( - shortDefinition="Person who received and recorded the answers", - formalDefinition="Person who received the answers to the questions in the Questionnaire and recorded them in the system" - ) - private ResourceReferenceDt myAuthor; - - @Child(name="source", order=4, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.RelatedPerson.class }) - @Description( - shortDefinition="The person who answered the questions", - formalDefinition="The person who answered the questions about the subject. Only used when this is not the subject him/herself" - ) - private ResourceReferenceDt mySource; - - @Child(name="name", type=CodeableConceptDt.class, order=5, min=0, max=1) - @Description( - shortDefinition="Name/code for a predefined list of questions", - formalDefinition="Structured name for a predefined list of questions this questionnaire is responding to" - ) - private BoundCodeableConceptDt myName; - - @Child(name="identifier", type=IdentifierDt.class, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="External Ids for this questionnaire", - formalDefinition="This records identifiers associated with this question/answer set that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation)" - ) - private java.util.List myIdentifier; - - @Child(name="encounter", order=7, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Encounter.class }) - @Description( - shortDefinition="Primary encounter during which the answers were collected", - formalDefinition="Encounter during which this questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers." - ) - private ResourceReferenceDt myEncounter; - - @Child(name="group", order=8, min=0, max=1) - @Description( - shortDefinition="Grouped questions", - formalDefinition="A group of questions to a possibly similarly grouped set of questions in the questionnaire" - ) - private Group myGroup; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myStatus, myAuthored, mySubject, myAuthor, mySource, myName, myIdentifier, myEncounter, myGroup); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myStatus, myAuthored, mySubject, myAuthor, mySource, myName, myIdentifier, myEncounter, myGroup); - } - - /** - * Gets the value(s) for status (draft | published | retired | in progress | completed | amended). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The lifecycle status of the questionnaire as a whole. - *

- */ - public BoundCodeDt getStatus() { - if (myStatus == null) { - myStatus = new BoundCodeDt(QuestionnaireStatusEnum.VALUESET_BINDER); - } - return myStatus; - } - - /** - * Sets the value(s) for status (draft | published | retired | in progress | completed | amended) - * - *

- * Definition: - * The lifecycle status of the questionnaire as a whole. - *

- */ - public Questionnaire setStatus(BoundCodeDt theValue) { - myStatus = theValue; - return this; - } - - /** - * Sets the value(s) for status (draft | published | retired | in progress | completed | amended) - * - *

- * Definition: - * The lifecycle status of the questionnaire as a whole. - *

- */ - public Questionnaire setStatus(QuestionnaireStatusEnum theValue) { - getStatus().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for authored (Date this version was authored). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The date and/or time that this version of the questionnaire was authored - *

- */ - public DateTimeDt getAuthored() { - if (myAuthored == null) { - myAuthored = new DateTimeDt(); - } - return myAuthored; - } - - /** - * Sets the value(s) for authored (Date this version was authored) - * - *

- * Definition: - * The date and/or time that this version of the questionnaire was authored - *

- */ - public Questionnaire setAuthored(DateTimeDt theValue) { - myAuthored = theValue; - return this; - } - - /** - * Sets the value for authored (Date this version was authored) - * - *

- * Definition: - * The date and/or time that this version of the questionnaire was authored - *

- */ - public Questionnaire setAuthoredWithSecondsPrecision( Date theDate) { - myAuthored = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for authored (Date this version was authored) - * - *

- * Definition: - * The date and/or time that this version of the questionnaire was authored - *

- */ - public Questionnaire setAuthored( Date theDate, TemporalPrecisionEnum thePrecision) { - myAuthored = new DateTimeDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for subject (The subject of the questions). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The subject of the questionnaires: this is the patient that the answers apply to, but this person is not necessarily the source of information - *

- */ - public ResourceReferenceDt getSubject() { - if (mySubject == null) { - mySubject = new ResourceReferenceDt(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (The subject of the questions) - * - *

- * Definition: - * The subject of the questionnaires: this is the patient that the answers apply to, but this person is not necessarily the source of information - *

- */ - public Questionnaire setSubject(ResourceReferenceDt theValue) { - mySubject = theValue; - return this; - } - - - /** - * Gets the value(s) for author (Person who received and recorded the answers). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Person who received the answers to the questions in the Questionnaire and recorded them in the system - *

- */ - public ResourceReferenceDt getAuthor() { - if (myAuthor == null) { - myAuthor = new ResourceReferenceDt(); - } - return myAuthor; - } - - /** - * Sets the value(s) for author (Person who received and recorded the answers) - * - *

- * Definition: - * Person who received the answers to the questions in the Questionnaire and recorded them in the system - *

- */ - public Questionnaire setAuthor(ResourceReferenceDt theValue) { - myAuthor = theValue; - return this; - } - - - /** - * Gets the value(s) for source (The person who answered the questions). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The person who answered the questions about the subject. Only used when this is not the subject him/herself - *

- */ - public ResourceReferenceDt getSource() { - if (mySource == null) { - mySource = new ResourceReferenceDt(); - } - return mySource; - } - - /** - * Sets the value(s) for source (The person who answered the questions) - * - *

- * Definition: - * The person who answered the questions about the subject. Only used when this is not the subject him/herself - *

- */ - public Questionnaire setSource(ResourceReferenceDt theValue) { - mySource = theValue; - return this; - } - - - /** - * Gets the value(s) for name (Name/code for a predefined list of questions). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Structured name for a predefined list of questions this questionnaire is responding to - *

- */ - public BoundCodeableConceptDt getName() { - if (myName == null) { - myName = new BoundCodeableConceptDt(QuestionnaireNameEnum.VALUESET_BINDER); - } - return myName; - } - - /** - * Sets the value(s) for name (Name/code for a predefined list of questions) - * - *

- * Definition: - * Structured name for a predefined list of questions this questionnaire is responding to - *

- */ - public Questionnaire setName(BoundCodeableConceptDt theValue) { - myName = theValue; - return this; - } - - /** - * Sets the value(s) for name (Name/code for a predefined list of questions) - * - *

- * Definition: - * Structured name for a predefined list of questions this questionnaire is responding to - *

- */ - public Questionnaire setName(QuestionnaireNameEnum theValue) { - getName().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for identifier (External Ids for this questionnaire). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * This records identifiers associated with this question/answer set that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (External Ids for this questionnaire) - * - *

- * Definition: - * This records identifiers associated with this question/answer set that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public Questionnaire setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (External Ids for this questionnaire) - * - *

- * Definition: - * This records identifiers associated with this question/answer set that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (External Ids for this questionnaire), - * creating it if it does not already exist. - * - *

- * Definition: - * This records identifiers associated with this question/answer set that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (External Ids for this questionnaire) - * - *

- * Definition: - * This records identifiers associated with this question/answer set that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Questionnaire addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (External Ids for this questionnaire) - * - *

- * Definition: - * This records identifiers associated with this question/answer set that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation) - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Questionnaire addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for encounter (Primary encounter during which the answers were collected). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Encounter during which this questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers. - *

- */ - public ResourceReferenceDt getEncounter() { - if (myEncounter == null) { - myEncounter = new ResourceReferenceDt(); - } - return myEncounter; - } - - /** - * Sets the value(s) for encounter (Primary encounter during which the answers were collected) - * - *

- * Definition: - * Encounter during which this questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers. - *

- */ - public Questionnaire setEncounter(ResourceReferenceDt theValue) { - myEncounter = theValue; - return this; - } - - - /** - * Gets the value(s) for group (Grouped questions). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A group of questions to a possibly similarly grouped set of questions in the questionnaire - *

- */ - public Group getGroup() { - if (myGroup == null) { - myGroup = new Group(); - } - return myGroup; - } - - /** - * Sets the value(s) for group (Grouped questions) - * - *

- * Definition: - * A group of questions to a possibly similarly grouped set of questions in the questionnaire - *

- */ - public Questionnaire setGroup(Group theValue) { - myGroup = theValue; - return this; - } - - - /** - * Block class for child element: Questionnaire.group (Grouped questions) - * - *

- * Definition: - * A group of questions to a possibly similarly grouped set of questions in the questionnaire - *

- */ - @Block() - public static class Group extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="name", type=CodeableConceptDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Code or name of the section on a questionnaire", - formalDefinition="Structured name for a section of a predefined list of questions this questionnaire is responding to." - ) - private BoundCodeableConceptDt myName; - - @Child(name="header", type=StringDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Text that is displayed above the contents of the group", - formalDefinition="" - ) - private StringDt myHeader; - - @Child(name="text", type=StringDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Additional text for the group", - formalDefinition="Additional text for the group, used for display purposes" - ) - private StringDt myText; - - @Child(name="subject", order=3, min=0, max=1, type={ - IResource.class }) - @Description( - shortDefinition="The subject this group's answers are about", - formalDefinition="More specific subject this section's answers are about, details the subject given in Questionnaire" - ) - private ResourceReferenceDt mySubject; - - @Child(name="group", type=Group.class, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Nested questionnaire group", - formalDefinition="A sub-group within a group. The ordering of groups within this group is relevant" - ) - private java.util.List myGroup; - - @Child(name="question", order=5, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Questions in this group", - formalDefinition="Set of questions within this group. The order of questions within the group is relevant" - ) - private java.util.List myQuestion; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myName, myHeader, myText, mySubject, myGroup, myQuestion); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myName, myHeader, myText, mySubject, myGroup, myQuestion); - } - - /** - * Gets the value(s) for name (Code or name of the section on a questionnaire). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Structured name for a section of a predefined list of questions this questionnaire is responding to. - *

- */ - public BoundCodeableConceptDt getName() { - if (myName == null) { - myName = new BoundCodeableConceptDt(QuestionnaireGroupNameEnum.VALUESET_BINDER); - } - return myName; - } - - /** - * Sets the value(s) for name (Code or name of the section on a questionnaire) - * - *

- * Definition: - * Structured name for a section of a predefined list of questions this questionnaire is responding to. - *

- */ - public Group setName(BoundCodeableConceptDt theValue) { - myName = theValue; - return this; - } - - /** - * Sets the value(s) for name (Code or name of the section on a questionnaire) - * - *

- * Definition: - * Structured name for a section of a predefined list of questions this questionnaire is responding to. - *

- */ - public Group setName(QuestionnaireGroupNameEnum theValue) { - getName().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for header (Text that is displayed above the contents of the group). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public StringDt getHeader() { - if (myHeader == null) { - myHeader = new StringDt(); - } - return myHeader; - } - - /** - * Sets the value(s) for header (Text that is displayed above the contents of the group) - * - *

- * Definition: - * - *

- */ - public Group setHeader(StringDt theValue) { - myHeader = theValue; - return this; - } - - /** - * Sets the value for header (Text that is displayed above the contents of the group) - * - *

- * Definition: - * - *

- */ - public Group setHeader( String theString) { - myHeader = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for text (Additional text for the group). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Additional text for the group, used for display purposes - *

- */ - public StringDt getText() { - if (myText == null) { - myText = new StringDt(); - } - return myText; - } - - /** - * Sets the value(s) for text (Additional text for the group) - * - *

- * Definition: - * Additional text for the group, used for display purposes - *

- */ - public Group setText(StringDt theValue) { - myText = theValue; - return this; - } - - /** - * Sets the value for text (Additional text for the group) - * - *

- * Definition: - * Additional text for the group, used for display purposes - *

- */ - public Group setText( String theString) { - myText = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for subject (The subject this group's answers are about). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * More specific subject this section's answers are about, details the subject given in Questionnaire - *

- */ - public ResourceReferenceDt getSubject() { - if (mySubject == null) { - mySubject = new ResourceReferenceDt(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (The subject this group's answers are about) - * - *

- * Definition: - * More specific subject this section's answers are about, details the subject given in Questionnaire - *

- */ - public Group setSubject(ResourceReferenceDt theValue) { - mySubject = theValue; - return this; - } - - - /** - * Gets the value(s) for group (Nested questionnaire group). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A sub-group within a group. The ordering of groups within this group is relevant - *

- */ - public java.util.List getGroup() { - if (myGroup == null) { - myGroup = new java.util.ArrayList(); - } - return myGroup; - } - - /** - * Sets the value(s) for group (Nested questionnaire group) - * - *

- * Definition: - * A sub-group within a group. The ordering of groups within this group is relevant - *

- */ - public Group setGroup(java.util.List theValue) { - myGroup = theValue; - return this; - } - - /** - * Adds and returns a new value for group (Nested questionnaire group) - * - *

- * Definition: - * A sub-group within a group. The ordering of groups within this group is relevant - *

- */ - public Group addGroup() { - Group newType = new Group(); - getGroup().add(newType); - return newType; - } - - /** - * Gets the first repetition for group (Nested questionnaire group), - * creating it if it does not already exist. - * - *

- * Definition: - * A sub-group within a group. The ordering of groups within this group is relevant - *

- */ - public Group getGroupFirstRep() { - if (getGroup().isEmpty()) { - return addGroup(); - } - return getGroup().get(0); - } - - /** - * Gets the value(s) for question (Questions in this group). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Set of questions within this group. The order of questions within the group is relevant - *

- */ - public java.util.List getQuestion() { - if (myQuestion == null) { - myQuestion = new java.util.ArrayList(); - } - return myQuestion; - } - - /** - * Sets the value(s) for question (Questions in this group) - * - *

- * Definition: - * Set of questions within this group. The order of questions within the group is relevant - *

- */ - public Group setQuestion(java.util.List theValue) { - myQuestion = theValue; - return this; - } - - /** - * Adds and returns a new value for question (Questions in this group) - * - *

- * Definition: - * Set of questions within this group. The order of questions within the group is relevant - *

- */ - public GroupQuestion addQuestion() { - GroupQuestion newType = new GroupQuestion(); - getQuestion().add(newType); - return newType; - } - - /** - * Gets the first repetition for question (Questions in this group), - * creating it if it does not already exist. - * - *

- * Definition: - * Set of questions within this group. The order of questions within the group is relevant - *

- */ - public GroupQuestion getQuestionFirstRep() { - if (getQuestion().isEmpty()) { - return addQuestion(); - } - return getQuestion().get(0); - } - - - } - - /** - * Block class for child element: Questionnaire.group.question (Questions in this group) - * - *

- * Definition: - * Set of questions within this group. The order of questions within the group is relevant - *

- */ - @Block() - public static class GroupQuestion extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="name", type=CodeableConceptDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Code or name of the question", - formalDefinition="Structured name for the question that identifies this question within the Questionnaire or Group" - ) - private CodeableConceptDt myName; - - @Child(name="text", type=StringDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Text of the question as it is shown to the user", - formalDefinition="" - ) - private StringDt myText; - - @Child(name="answer", order=2, min=0, max=1, type={ - DecimalDt.class, IntegerDt.class, BooleanDt.class, DateDt.class, StringDt.class, DateTimeDt.class, InstantDt.class }) - @Description( - shortDefinition="Single-valued answer to the question", - formalDefinition="Single-valued answer to the question" - ) - private IDatatype myAnswer; - - @Child(name="choice", type=CodingDt.class, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Selected options", - formalDefinition="Selections made by the user from the list of options" - ) - private java.util.List myChoice; - - @Child(name="options", order=4, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.ValueSet.class }) - @Description( - shortDefinition="Valueset containing the possible options", - formalDefinition="Reference to a valueset containing the possible options" - ) - private ResourceReferenceDt myOptions; - - @Child(name="data", type=IDatatype.class, order=5, min=0, max=1) - @Description( - shortDefinition="Structured answer", - formalDefinition="Structured answer in the form of a FHIR Resource or datatype" - ) - private IDatatype myData; - - @Child(name="remarks", type=StringDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="Remarks about the answer given", - formalDefinition="The remark contains information about the answer given. This is additional information about the answer the author wishes to convey, but should not be used to contain information that is part of the answer itself." - ) - private StringDt myRemarks; - - @Child(name="group", type=Group.class, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Nested questionnaire group", - formalDefinition="Nested group, containing nested question for this question. The order of groups within the question is relevant" - ) - private java.util.List myGroup; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myName, myText, myAnswer, myChoice, myOptions, myData, myRemarks, myGroup); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myName, myText, myAnswer, myChoice, myOptions, myData, myRemarks, myGroup); - } - - /** - * Gets the value(s) for name (Code or name of the question). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Structured name for the question that identifies this question within the Questionnaire or Group - *

- */ - public CodeableConceptDt getName() { - if (myName == null) { - myName = new CodeableConceptDt(); - } - return myName; - } - - /** - * Sets the value(s) for name (Code or name of the question) - * - *

- * Definition: - * Structured name for the question that identifies this question within the Questionnaire or Group - *

- */ - public GroupQuestion setName(CodeableConceptDt theValue) { - myName = theValue; - return this; - } - - - /** - * Gets the value(s) for text (Text of the question as it is shown to the user). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public StringDt getText() { - if (myText == null) { - myText = new StringDt(); - } - return myText; - } - - /** - * Sets the value(s) for text (Text of the question as it is shown to the user) - * - *

- * Definition: - * - *

- */ - public GroupQuestion setText(StringDt theValue) { - myText = theValue; - return this; - } - - /** - * Sets the value for text (Text of the question as it is shown to the user) - * - *

- * Definition: - * - *

- */ - public GroupQuestion setText( String theString) { - myText = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for answer[x] (Single-valued answer to the question). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Single-valued answer to the question - *

- */ - public IDatatype getAnswer() { - return myAnswer; - } - - /** - * Sets the value(s) for answer[x] (Single-valued answer to the question) - * - *

- * Definition: - * Single-valued answer to the question - *

- */ - public GroupQuestion setAnswer(IDatatype theValue) { - myAnswer = theValue; - return this; - } - - - /** - * Gets the value(s) for choice (Selected options). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Selections made by the user from the list of options - *

- */ - public java.util.List getChoice() { - if (myChoice == null) { - myChoice = new java.util.ArrayList(); - } - return myChoice; - } - - /** - * Sets the value(s) for choice (Selected options) - * - *

- * Definition: - * Selections made by the user from the list of options - *

- */ - public GroupQuestion setChoice(java.util.List theValue) { - myChoice = theValue; - return this; - } - - /** - * Adds and returns a new value for choice (Selected options) - * - *

- * Definition: - * Selections made by the user from the list of options - *

- */ - public CodingDt addChoice() { - CodingDt newType = new CodingDt(); - getChoice().add(newType); - return newType; - } - - /** - * Gets the first repetition for choice (Selected options), - * creating it if it does not already exist. - * - *

- * Definition: - * Selections made by the user from the list of options - *

- */ - public CodingDt getChoiceFirstRep() { - if (getChoice().isEmpty()) { - return addChoice(); - } - return getChoice().get(0); - } - - /** - * Gets the value(s) for options (Valueset containing the possible options). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Reference to a valueset containing the possible options - *

- */ - public ResourceReferenceDt getOptions() { - if (myOptions == null) { - myOptions = new ResourceReferenceDt(); - } - return myOptions; - } - - /** - * Sets the value(s) for options (Valueset containing the possible options) - * - *

- * Definition: - * Reference to a valueset containing the possible options - *

- */ - public GroupQuestion setOptions(ResourceReferenceDt theValue) { - myOptions = theValue; - return this; - } - - - /** - * Gets the value(s) for data[x] (Structured answer). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Structured answer in the form of a FHIR Resource or datatype - *

- */ - public IDatatype getData() { - return myData; - } - - /** - * Sets the value(s) for data[x] (Structured answer) - * - *

- * Definition: - * Structured answer in the form of a FHIR Resource or datatype - *

- */ - public GroupQuestion setData(IDatatype theValue) { - myData = theValue; - return this; - } - - - /** - * Gets the value(s) for remarks (Remarks about the answer given). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The remark contains information about the answer given. This is additional information about the answer the author wishes to convey, but should not be used to contain information that is part of the answer itself. - *

- */ - public StringDt getRemarks() { - if (myRemarks == null) { - myRemarks = new StringDt(); - } - return myRemarks; - } - - /** - * Sets the value(s) for remarks (Remarks about the answer given) - * - *

- * Definition: - * The remark contains information about the answer given. This is additional information about the answer the author wishes to convey, but should not be used to contain information that is part of the answer itself. - *

- */ - public GroupQuestion setRemarks(StringDt theValue) { - myRemarks = theValue; - return this; - } - - /** - * Sets the value for remarks (Remarks about the answer given) - * - *

- * Definition: - * The remark contains information about the answer given. This is additional information about the answer the author wishes to convey, but should not be used to contain information that is part of the answer itself. - *

- */ - public GroupQuestion setRemarks( String theString) { - myRemarks = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for group (Nested questionnaire group). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Nested group, containing nested question for this question. The order of groups within the question is relevant - *

- */ - public java.util.List getGroup() { - if (myGroup == null) { - myGroup = new java.util.ArrayList(); - } - return myGroup; - } - - /** - * Sets the value(s) for group (Nested questionnaire group) - * - *

- * Definition: - * Nested group, containing nested question for this question. The order of groups within the question is relevant - *

- */ - public GroupQuestion setGroup(java.util.List theValue) { - myGroup = theValue; - return this; - } - - /** - * Adds and returns a new value for group (Nested questionnaire group) - * - *

- * Definition: - * Nested group, containing nested question for this question. The order of groups within the question is relevant - *

- */ - public Group addGroup() { - Group newType = new Group(); - getGroup().add(newType); - return newType; - } - - /** - * Gets the first repetition for group (Nested questionnaire group), - * creating it if it does not already exist. - * - *

- * Definition: - * Nested group, containing nested question for this question. The order of groups within the question is relevant - *

- */ - public Group getGroupFirstRep() { - if (getGroup().isEmpty()) { - return addGroup(); - } - return getGroup().get(0); - } - - - } - - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/RelatedPerson.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/RelatedPerson.java deleted file mode 100644 index b72577e5d60..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/RelatedPerson.java +++ /dev/null @@ -1,747 +0,0 @@ - - - - - - - - - - - - - - - - -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.List; - -import ca.uhn.fhir.model.api.BaseResource; -import ca.uhn.fhir.model.api.IElement; -import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.api.Include; -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.AddressDt; -import ca.uhn.fhir.model.dstu.composite.AttachmentDt; -import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.ContactDt; -import ca.uhn.fhir.model.dstu.composite.HumanNameDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.PatientRelationshipTypeEnum; -import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.StringClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR RelatedPerson Resource - * (An person that is related to a patient, but who is not a direct target of care) - * - *

- * Definition: - * Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process - *

- * - *

- * Requirements: - * Need to track persons related to the patient or the healthcare process. - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/RelatedPerson - *

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

- * Description: A patient Identifier
- * Type: token
- * Path: RelatedPerson.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="RelatedPerson.identifier", description="A patient Identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - - /** - * Fluent Client search parameter constant for identifier - *

- * Description: A patient Identifier
- * Type: token
- * Path: RelatedPerson.identifier
- *

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

- * Description: A portion of name in any name part
- * Type: string
- * Path: RelatedPerson.name
- *

- */ - @SearchParamDefinition(name="name", path="RelatedPerson.name", description="A portion of name in any name part", type="string" ) - public static final String SP_NAME = "name"; - - /** - * Fluent Client search parameter constant for name - *

- * Description: A portion of name in any name part
- * Type: string
- * Path: RelatedPerson.name
- *

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

- * Description: A portion of name using some kind of phonetic matching algorithm
- * Type: string
- * Path:
- *

- */ - @SearchParamDefinition(name="phonetic", path="", description="A portion of name using some kind of phonetic matching algorithm", type="string" ) - public static final String SP_PHONETIC = "phonetic"; - - /** - * Fluent Client search parameter constant for phonetic - *

- * Description: A portion of name using some kind of phonetic matching algorithm
- * Type: string
- * Path:
- *

- */ - public static final StringClientParam PHONETIC = new StringClientParam(SP_PHONETIC); - - /** - * Search parameter constant for telecom - *

- * Description: The value in any kind of contact
- * Type: string
- * Path: RelatedPerson.telecom
- *

- */ - @SearchParamDefinition(name="telecom", path="RelatedPerson.telecom", description="The value in any kind of contact", type="string" ) - public static final String SP_TELECOM = "telecom"; - - /** - * Fluent Client search parameter constant for telecom - *

- * Description: The value in any kind of contact
- * Type: string
- * Path: RelatedPerson.telecom
- *

- */ - public static final StringClientParam TELECOM = new StringClientParam(SP_TELECOM); - - /** - * Search parameter constant for address - *

- * Description: An address in any kind of address/part
- * Type: string
- * Path: RelatedPerson.address
- *

- */ - @SearchParamDefinition(name="address", path="RelatedPerson.address", description="An address in any kind of address/part", type="string" ) - public static final String SP_ADDRESS = "address"; - - /** - * Fluent Client search parameter constant for address - *

- * Description: An address in any kind of address/part
- * Type: string
- * Path: RelatedPerson.address
- *

- */ - public static final StringClientParam ADDRESS = new StringClientParam(SP_ADDRESS); - - /** - * Search parameter constant for gender - *

- * Description: Gender of the person
- * Type: token
- * Path: RelatedPerson.gender
- *

- */ - @SearchParamDefinition(name="gender", path="RelatedPerson.gender", description="Gender of the person", type="token" ) - public static final String SP_GENDER = "gender"; - - /** - * Fluent Client search parameter constant for gender - *

- * Description: Gender of the person
- * Type: token
- * Path: RelatedPerson.gender
- *

- */ - public static final TokenClientParam GENDER = new TokenClientParam(SP_GENDER); - - /** - * Search parameter constant for patient - *

- * Description: The patient this person is related to
- * Type: reference
- * Path: RelatedPerson.patient
- *

- */ - @SearchParamDefinition(name="patient", path="RelatedPerson.patient", description="The patient this person is related to", type="reference" ) - public static final String SP_PATIENT = "patient"; - - /** - * Fluent Client search parameter constant for patient - *

- * Description: The patient this person is related to
- * Type: reference
- * Path: RelatedPerson.patient
- *

- */ - public static final ReferenceClientParam PATIENT = new ReferenceClientParam(SP_PATIENT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "RelatedPerson.patient". - */ - public static final Include INCLUDE_PATIENT = new Include("RelatedPerson.patient"); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="A Human identifier for this person", - formalDefinition="Identifier for a person within a particular scope." - ) - private java.util.List myIdentifier; - - @Child(name="patient", order=1, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="The patient this person is related to", - formalDefinition="The patient this person is related to" - ) - private ResourceReferenceDt myPatient; - - @Child(name="relationship", type=CodeableConceptDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="The nature of the relationship", - formalDefinition="The nature of the relationship between a patient and the related person" - ) - private BoundCodeableConceptDt myRelationship; - - @Child(name="name", type=HumanNameDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="A name associated with the person", - formalDefinition="A name associated with the person" - ) - private HumanNameDt myName; - - @Child(name="telecom", type=ContactDt.class, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="A contact detail for the person", - formalDefinition="A contact detail for the person, e.g. a telephone number or an email address." - ) - private java.util.List myTelecom; - - @Child(name="gender", type=CodeableConceptDt.class, order=5, min=0, max=1) - @Description( - shortDefinition="Gender for administrative purposes", - formalDefinition="Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes." - ) - private BoundCodeableConceptDt myGender; - - @Child(name="address", type=AddressDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="Address where the related person can be contacted or visited", - formalDefinition="Address where the related person can be contacted or visited" - ) - private AddressDt myAddress; - - @Child(name="photo", type=AttachmentDt.class, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Image of the person", - formalDefinition="Image of the person" - ) - private java.util.List myPhoto; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myPatient, myRelationship, myName, myTelecom, myGender, myAddress, myPhoto); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myPatient, myRelationship, myName, myTelecom, myGender, myAddress, myPhoto); - } - - /** - * Gets the value(s) for identifier (A Human identifier for this person). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (A Human identifier for this person) - * - *

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

- */ - public RelatedPerson setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (A Human identifier for this person) - * - *

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

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (A Human identifier for this person), - * creating it if it does not already exist. - * - *

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

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (A Human identifier for this person) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public RelatedPerson addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (A Human identifier for this person) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public RelatedPerson addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for patient (The patient this person is related to). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The patient this person is related to - *

- */ - public ResourceReferenceDt getPatient() { - if (myPatient == null) { - myPatient = new ResourceReferenceDt(); - } - return myPatient; - } - - /** - * Sets the value(s) for patient (The patient this person is related to) - * - *

- * Definition: - * The patient this person is related to - *

- */ - public RelatedPerson setPatient(ResourceReferenceDt theValue) { - myPatient = theValue; - return this; - } - - - /** - * Gets the value(s) for relationship (The nature of the relationship). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The nature of the relationship between a patient and the related person - *

- */ - public BoundCodeableConceptDt getRelationship() { - if (myRelationship == null) { - myRelationship = new BoundCodeableConceptDt(PatientRelationshipTypeEnum.VALUESET_BINDER); - } - return myRelationship; - } - - /** - * Sets the value(s) for relationship (The nature of the relationship) - * - *

- * Definition: - * The nature of the relationship between a patient and the related person - *

- */ - public RelatedPerson setRelationship(BoundCodeableConceptDt theValue) { - myRelationship = theValue; - return this; - } - - /** - * Sets the value(s) for relationship (The nature of the relationship) - * - *

- * Definition: - * The nature of the relationship between a patient and the related person - *

- */ - public RelatedPerson setRelationship(PatientRelationshipTypeEnum theValue) { - getRelationship().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for name (A name associated with the person). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A name associated with the person - *

- */ - public HumanNameDt getName() { - if (myName == null) { - myName = new HumanNameDt(); - } - return myName; - } - - /** - * Sets the value(s) for name (A name associated with the person) - * - *

- * Definition: - * A name associated with the person - *

- */ - public RelatedPerson setName(HumanNameDt theValue) { - myName = theValue; - return this; - } - - - /** - * Gets the value(s) for telecom (A contact detail for the person). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getTelecom() { - if (myTelecom == null) { - myTelecom = new java.util.ArrayList(); - } - return myTelecom; - } - - /** - * Sets the value(s) for telecom (A contact detail for the person) - * - *

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

- */ - public RelatedPerson setTelecom(java.util.List theValue) { - myTelecom = theValue; - return this; - } - - /** - * Adds and returns a new value for telecom (A contact detail for the person) - * - *

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

- */ - public ContactDt addTelecom() { - ContactDt newType = new ContactDt(); - getTelecom().add(newType); - return newType; - } - - /** - * Gets the first repetition for telecom (A contact detail for the person), - * creating it if it does not already exist. - * - *

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

- */ - public ContactDt getTelecomFirstRep() { - if (getTelecom().isEmpty()) { - return addTelecom(); - } - return getTelecom().get(0); - } - /** - * Adds a new value for telecom (A contact detail for the person) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public RelatedPerson 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 (A contact detail for the person) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public RelatedPerson addTelecom( String theValue) { - if (myTelecom == null) { - myTelecom = new java.util.ArrayList(); - } - myTelecom.add(new ContactDt(theValue)); - return this; - } - - - /** - * Gets the value(s) for gender (Gender for administrative purposes). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - *

- */ - public BoundCodeableConceptDt getGender() { - if (myGender == null) { - myGender = new BoundCodeableConceptDt(AdministrativeGenderCodesEnum.VALUESET_BINDER); - } - return myGender; - } - - /** - * Sets the value(s) for gender (Gender for administrative purposes) - * - *

- * Definition: - * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - *

- */ - public RelatedPerson setGender(BoundCodeableConceptDt theValue) { - myGender = theValue; - return this; - } - - /** - * Sets the value(s) for gender (Gender for administrative purposes) - * - *

- * Definition: - * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - *

- */ - public RelatedPerson setGender(AdministrativeGenderCodesEnum theValue) { - getGender().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for address (Address where the related person can be contacted or visited). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Address where the related person can be contacted or visited - *

- */ - public AddressDt getAddress() { - if (myAddress == null) { - myAddress = new AddressDt(); - } - return myAddress; - } - - /** - * Sets the value(s) for address (Address where the related person can be contacted or visited) - * - *

- * Definition: - * Address where the related person can be contacted or visited - *

- */ - public RelatedPerson setAddress(AddressDt theValue) { - myAddress = theValue; - return this; - } - - - /** - * Gets the value(s) for photo (Image of the person). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Image of the person - *

- */ - public java.util.List getPhoto() { - if (myPhoto == null) { - myPhoto = new java.util.ArrayList(); - } - return myPhoto; - } - - /** - * Sets the value(s) for photo (Image of the person) - * - *

- * Definition: - * Image of the person - *

- */ - public RelatedPerson setPhoto(java.util.List theValue) { - myPhoto = theValue; - return this; - } - - /** - * Adds and returns a new value for photo (Image of the person) - * - *

- * Definition: - * Image of the person - *

- */ - public AttachmentDt addPhoto() { - AttachmentDt newType = new AttachmentDt(); - getPhoto().add(newType); - return newType; - } - - /** - * Gets the first repetition for photo (Image of the person), - * creating it if it does not already exist. - * - *

- * Definition: - * Image of the person - *

- */ - public AttachmentDt getPhotoFirstRep() { - if (getPhoto().isEmpty()) { - return addPhoto(); - } - return getPhoto().get(0); - } - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Remittance.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Remittance.java deleted file mode 100644 index c167fd52eab..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Remittance.java +++ /dev/null @@ -1,539 +0,0 @@ - - - - - - - - - - - - - - - - -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.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.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.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.primitive.DecimalDt; -import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR Remittance Resource - * (A remittance) - * - *

- * Definition: - * A remittance - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Remittance - *

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

- * Description:
- * Type: token
- * Path: Remittance.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Remittance.identifier", description="", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - - /** - * Fluent Client search parameter constant for identifier - *

- * Description:
- * Type: token
- * Path: Remittance.identifier
- *

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

- * Description:
- * Type: token
- * Path: Remittance.service.code
- *

- */ - @SearchParamDefinition(name="service", path="Remittance.service.code", description="", type="token" ) - public static final String SP_SERVICE = "service"; - - /** - * Fluent Client search parameter constant for service - *

- * Description:
- * Type: token
- * Path: Remittance.service.code
- *

- */ - public static final TokenClientParam SERVICE = new TokenClientParam(SP_SERVICE); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Remittance id", - formalDefinition="The remittance identifier" - ) - private IdentifierDt myIdentifier; - - @Child(name="service", order=1, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="A service paid as part of remittance", - formalDefinition="A service paid as part of remittance" - ) - private java.util.List myService; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myService); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myService); - } - - /** - * Gets the value(s) for identifier (Remittance id). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The remittance identifier - *

- */ - public IdentifierDt getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new IdentifierDt(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Remittance id) - * - *

- * Definition: - * The remittance identifier - *

- */ - public Remittance setIdentifier(IdentifierDt theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Sets the value for identifier (Remittance id) - * - *

- * Definition: - * The remittance identifier - *

- */ - public Remittance setIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - myIdentifier = new IdentifierDt(theUse, theSystem, theValue, theLabel); - return this; - } - - /** - * Sets the value for identifier (Remittance id) - * - *

- * Definition: - * The remittance identifier - *

- */ - public Remittance setIdentifier( String theSystem, String theValue) { - myIdentifier = new IdentifierDt(theSystem, theValue); - return this; - } - - - /** - * Gets the value(s) for service (A service paid as part of remittance). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A service paid as part of remittance - *

- */ - public java.util.List getService() { - if (myService == null) { - myService = new java.util.ArrayList(); - } - return myService; - } - - /** - * Sets the value(s) for service (A service paid as part of remittance) - * - *

- * Definition: - * A service paid as part of remittance - *

- */ - public Remittance setService(java.util.List theValue) { - myService = theValue; - return this; - } - - /** - * Adds and returns a new value for service (A service paid as part of remittance) - * - *

- * Definition: - * A service paid as part of remittance - *

- */ - public Service addService() { - Service newType = new Service(); - getService().add(newType); - return newType; - } - - /** - * Gets the first repetition for service (A service paid as part of remittance), - * creating it if it does not already exist. - * - *

- * Definition: - * A service paid as part of remittance - *

- */ - public Service getServiceFirstRep() { - if (getService().isEmpty()) { - return addService(); - } - return getService().get(0); - } - - /** - * Block class for child element: Remittance.service (A service paid as part of remittance) - * - *

- * Definition: - * A service paid as part of remittance - *

- */ - @Block() - public static class Service extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="instance", type=IntegerDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Service instance number", - formalDefinition="The service instance number for the original transaction" - ) - private IntegerDt myInstance; - - @Child(name="code", type=CodeableConceptDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="Professional service code", - formalDefinition="The code for the professional service" - ) - private CodeableConceptDt myCode; - - @Child(name="rate", type=DecimalDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Benefit Rate %", - formalDefinition="The percent of the service fee which would be elegible for coverage" - ) - private DecimalDt myRate; - - @Child(name="benefit", type=DecimalDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Benefit amount", - formalDefinition="The amount payable for a submitted service (includes both professional and lab fees.)" - ) - private DecimalDt myBenefit; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myInstance, myCode, myRate, myBenefit); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myInstance, myCode, myRate, myBenefit); - } - - /** - * Gets the value(s) for instance (Service instance number). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The service instance number for the original transaction - *

- */ - public IntegerDt getInstance() { - if (myInstance == null) { - myInstance = new IntegerDt(); - } - return myInstance; - } - - /** - * Sets the value(s) for instance (Service instance number) - * - *

- * Definition: - * The service instance number for the original transaction - *

- */ - public Service setInstance(IntegerDt theValue) { - myInstance = theValue; - return this; - } - - /** - * Sets the value for instance (Service instance number) - * - *

- * Definition: - * The service instance number for the original transaction - *

- */ - public Service setInstance( int theInteger) { - myInstance = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for code (Professional service code). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The code for the professional service - *

- */ - public CodeableConceptDt getCode() { - if (myCode == null) { - myCode = new CodeableConceptDt(); - } - return myCode; - } - - /** - * Sets the value(s) for code (Professional service code) - * - *

- * Definition: - * The code for the professional service - *

- */ - public Service setCode(CodeableConceptDt theValue) { - myCode = theValue; - return this; - } - - - /** - * Gets the value(s) for rate (Benefit Rate %). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The percent of the service fee which would be elegible for coverage - *

- */ - public DecimalDt getRate() { - if (myRate == null) { - myRate = new DecimalDt(); - } - return myRate; - } - - /** - * Sets the value(s) for rate (Benefit Rate %) - * - *

- * Definition: - * The percent of the service fee which would be elegible for coverage - *

- */ - public Service setRate(DecimalDt theValue) { - myRate = theValue; - return this; - } - - /** - * Sets the value for rate (Benefit Rate %) - * - *

- * Definition: - * The percent of the service fee which would be elegible for coverage - *

- */ - public Service setRate( long theValue) { - myRate = new DecimalDt(theValue); - return this; - } - - /** - * Sets the value for rate (Benefit Rate %) - * - *

- * Definition: - * The percent of the service fee which would be elegible for coverage - *

- */ - public Service setRate( double theValue) { - myRate = new DecimalDt(theValue); - return this; - } - - /** - * Sets the value for rate (Benefit Rate %) - * - *

- * Definition: - * The percent of the service fee which would be elegible for coverage - *

- */ - public Service setRate( java.math.BigDecimal theValue) { - myRate = new DecimalDt(theValue); - return this; - } - - - /** - * Gets the value(s) for benefit (Benefit amount). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The amount payable for a submitted service (includes both professional and lab fees.) - *

- */ - public DecimalDt getBenefit() { - if (myBenefit == null) { - myBenefit = new DecimalDt(); - } - return myBenefit; - } - - /** - * Sets the value(s) for benefit (Benefit amount) - * - *

- * Definition: - * The amount payable for a submitted service (includes both professional and lab fees.) - *

- */ - public Service setBenefit(DecimalDt theValue) { - myBenefit = theValue; - return this; - } - - /** - * Sets the value for benefit (Benefit amount) - * - *

- * Definition: - * The amount payable for a submitted service (includes both professional and lab fees.) - *

- */ - public Service setBenefit( long theValue) { - myBenefit = new DecimalDt(theValue); - return this; - } - - /** - * Sets the value for benefit (Benefit amount) - * - *

- * Definition: - * The amount payable for a submitted service (includes both professional and lab fees.) - *

- */ - public Service setBenefit( double theValue) { - myBenefit = new DecimalDt(theValue); - return this; - } - - /** - * Sets the value for benefit (Benefit amount) - * - *

- * Definition: - * The amount payable for a submitted service (includes both professional and lab fees.) - *

- */ - public Service setBenefit( java.math.BigDecimal theValue) { - myBenefit = new DecimalDt(theValue); - return this; - } - - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SecurityEvent.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SecurityEvent.java deleted file mode 100644 index c295fc902e5..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SecurityEvent.java +++ /dev/null @@ -1,2412 +0,0 @@ - - - - - - - - - - - - - - - - -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.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.SecurityEventActionEnum; -import ca.uhn.fhir.model.dstu.valueset.SecurityEventObjectLifecycleEnum; -import ca.uhn.fhir.model.dstu.valueset.SecurityEventObjectRoleEnum; -import ca.uhn.fhir.model.dstu.valueset.SecurityEventObjectSensitivityEnum; -import ca.uhn.fhir.model.dstu.valueset.SecurityEventObjectTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.SecurityEventOutcomeEnum; -import ca.uhn.fhir.model.dstu.valueset.SecurityEventParticipantNetworkTypeEnum; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; -import ca.uhn.fhir.model.primitive.BooleanDt; -import ca.uhn.fhir.model.primitive.BoundCodeDt; -import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; -import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.InstantDt; -import ca.uhn.fhir.model.primitive.StringDt; -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 SecurityEvent Resource - * (Event record kept for security purposes) - * - *

- * Definition: - * A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/SecurityEvent - *

- * - */ -@ResourceDef(name="SecurityEvent", profile="http://hl7.org/fhir/profiles/SecurityEvent", id="securityevent") -public class SecurityEvent extends BaseResource implements IResource { - - /** - * Search parameter constant for type - *

- * Description:
- * Type: token
- * Path: SecurityEvent.event.type
- *

- */ - @SearchParamDefinition(name="type", path="SecurityEvent.event.type", description="", type="token" ) - public static final String SP_TYPE = "type"; - - /** - * Fluent Client search parameter constant for type - *

- * Description:
- * Type: token
- * Path: SecurityEvent.event.type
- *

- */ - public static final TokenClientParam TYPE = new TokenClientParam(SP_TYPE); - - /** - * Search parameter constant for action - *

- * Description:
- * Type: token
- * Path: SecurityEvent.event.action
- *

- */ - @SearchParamDefinition(name="action", path="SecurityEvent.event.action", description="", type="token" ) - public static final String SP_ACTION = "action"; - - /** - * Fluent Client search parameter constant for action - *

- * Description:
- * Type: token
- * Path: SecurityEvent.event.action
- *

- */ - public static final TokenClientParam ACTION = new TokenClientParam(SP_ACTION); - - /** - * Search parameter constant for date - *

- * Description:
- * Type: date
- * Path: SecurityEvent.event.dateTime
- *

- */ - @SearchParamDefinition(name="date", path="SecurityEvent.event.dateTime", description="", type="date" ) - public static final String SP_DATE = "date"; - - /** - * Fluent Client search parameter constant for date - *

- * Description:
- * Type: date
- * Path: SecurityEvent.event.dateTime
- *

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

- * Description:
- * Type: token
- * Path: SecurityEvent.event.subtype
- *

- */ - @SearchParamDefinition(name="subtype", path="SecurityEvent.event.subtype", description="", type="token" ) - public static final String SP_SUBTYPE = "subtype"; - - /** - * Fluent Client search parameter constant for subtype - *

- * Description:
- * Type: token
- * Path: SecurityEvent.event.subtype
- *

- */ - public static final TokenClientParam SUBTYPE = new TokenClientParam(SP_SUBTYPE); - - /** - * Search parameter constant for user - *

- * Description:
- * Type: token
- * Path: SecurityEvent.participant.userId
- *

- */ - @SearchParamDefinition(name="user", path="SecurityEvent.participant.userId", description="", type="token" ) - public static final String SP_USER = "user"; - - /** - * Fluent Client search parameter constant for user - *

- * Description:
- * Type: token
- * Path: SecurityEvent.participant.userId
- *

- */ - public static final TokenClientParam USER = new TokenClientParam(SP_USER); - - /** - * Search parameter constant for name - *

- * Description:
- * Type: string
- * Path: SecurityEvent.participant.name
- *

- */ - @SearchParamDefinition(name="name", path="SecurityEvent.participant.name", description="", type="string" ) - public static final String SP_NAME = "name"; - - /** - * Fluent Client search parameter constant for name - *

- * Description:
- * Type: string
- * Path: SecurityEvent.participant.name
- *

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

- * Description:
- * Type: token
- * Path: SecurityEvent.participant.network.identifier
- *

- */ - @SearchParamDefinition(name="address", path="SecurityEvent.participant.network.identifier", description="", type="token" ) - public static final String SP_ADDRESS = "address"; - - /** - * Fluent Client search parameter constant for address - *

- * Description:
- * Type: token
- * Path: SecurityEvent.participant.network.identifier
- *

- */ - public static final TokenClientParam ADDRESS = new TokenClientParam(SP_ADDRESS); - - /** - * Search parameter constant for source - *

- * Description:
- * Type: token
- * Path: SecurityEvent.source.identifier
- *

- */ - @SearchParamDefinition(name="source", path="SecurityEvent.source.identifier", description="", type="token" ) - public static final String SP_SOURCE = "source"; - - /** - * Fluent Client search parameter constant for source - *

- * Description:
- * Type: token
- * Path: SecurityEvent.source.identifier
- *

- */ - public static final TokenClientParam SOURCE = new TokenClientParam(SP_SOURCE); - - /** - * Search parameter constant for site - *

- * Description:
- * Type: token
- * Path: SecurityEvent.source.site
- *

- */ - @SearchParamDefinition(name="site", path="SecurityEvent.source.site", description="", type="token" ) - public static final String SP_SITE = "site"; - - /** - * Fluent Client search parameter constant for site - *

- * Description:
- * Type: token
- * Path: SecurityEvent.source.site
- *

- */ - public static final TokenClientParam SITE = new TokenClientParam(SP_SITE); - - /** - * Search parameter constant for object-type - *

- * Description:
- * Type: token
- * Path: SecurityEvent.object.type
- *

- */ - @SearchParamDefinition(name="object-type", path="SecurityEvent.object.type", description="", type="token" ) - public static final String SP_OBJECT_TYPE = "object-type"; - - /** - * Fluent Client search parameter constant for object-type - *

- * Description:
- * Type: token
- * Path: SecurityEvent.object.type
- *

- */ - public static final TokenClientParam OBJECT_TYPE = new TokenClientParam(SP_OBJECT_TYPE); - - /** - * Search parameter constant for identity - *

- * Description:
- * Type: token
- * Path: SecurityEvent.object.identifier
- *

- */ - @SearchParamDefinition(name="identity", path="SecurityEvent.object.identifier", description="", type="token" ) - public static final String SP_IDENTITY = "identity"; - - /** - * Fluent Client search parameter constant for identity - *

- * Description:
- * Type: token
- * Path: SecurityEvent.object.identifier
- *

- */ - public static final TokenClientParam IDENTITY = new TokenClientParam(SP_IDENTITY); - - /** - * Search parameter constant for reference - *

- * Description:
- * Type: reference
- * Path: SecurityEvent.object.reference
- *

- */ - @SearchParamDefinition(name="reference", path="SecurityEvent.object.reference", description="", type="reference" ) - public static final String SP_REFERENCE = "reference"; - - /** - * Fluent Client search parameter constant for reference - *

- * Description:
- * Type: reference
- * Path: SecurityEvent.object.reference
- *

- */ - public static final ReferenceClientParam REFERENCE = new ReferenceClientParam(SP_REFERENCE); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "SecurityEvent.object.reference". - */ - public static final Include INCLUDE_OBJECT_REFERENCE = new Include("SecurityEvent.object.reference"); - - /** - * Search parameter constant for desc - *

- * Description:
- * Type: string
- * Path: SecurityEvent.object.name
- *

- */ - @SearchParamDefinition(name="desc", path="SecurityEvent.object.name", description="", type="string" ) - public static final String SP_DESC = "desc"; - - /** - * Fluent Client search parameter constant for desc - *

- * Description:
- * Type: string
- * Path: SecurityEvent.object.name
- *

- */ - public static final StringClientParam DESC = new StringClientParam(SP_DESC); - - /** - * Search parameter constant for patientid - *

- * Description: The id of the patient (one of multiple kinds of participations)
- * Type: token
- * Path:
- *

- */ - @SearchParamDefinition(name="patientid", path="", description="The id of the patient (one of multiple kinds of participations)", type="token" ) - public static final String SP_PATIENTID = "patientid"; - - /** - * Fluent Client search parameter constant for patientid - *

- * Description: The id of the patient (one of multiple kinds of participations)
- * Type: token
- * Path:
- *

- */ - public static final TokenClientParam PATIENTID = new TokenClientParam(SP_PATIENTID); - - /** - * Search parameter constant for altid - *

- * Description:
- * Type: token
- * Path: SecurityEvent.participant.altId
- *

- */ - @SearchParamDefinition(name="altid", path="SecurityEvent.participant.altId", description="", type="token" ) - public static final String SP_ALTID = "altid"; - - /** - * Fluent Client search parameter constant for altid - *

- * Description:
- * Type: token
- * Path: SecurityEvent.participant.altId
- *

- */ - public static final TokenClientParam ALTID = new TokenClientParam(SP_ALTID); - - - @Child(name="event", order=0, min=1, max=1) - @Description( - shortDefinition="What was done", - formalDefinition="Identifies the name, action type, time, and disposition of the audited event" - ) - private Event myEvent; - - @Child(name="participant", order=1, min=1, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="A person, a hardware device or software process", - formalDefinition="" - ) - private java.util.List myParticipant; - - @Child(name="source", order=2, min=1, max=1) - @Description( - shortDefinition="Application systems and processes", - formalDefinition="" - ) - private Source mySource; - - @Child(name="object", order=3, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Specific instances of data or objects that have been accessed", - formalDefinition="Specific instances of data or objects that have been accessed" - ) - private java.util.List myObject; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myEvent, myParticipant, mySource, myObject); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myEvent, myParticipant, mySource, myObject); - } - - /** - * Gets the value(s) for event (What was done). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the name, action type, time, and disposition of the audited event - *

- */ - public Event getEvent() { - if (myEvent == null) { - myEvent = new Event(); - } - return myEvent; - } - - /** - * Sets the value(s) for event (What was done) - * - *

- * Definition: - * Identifies the name, action type, time, and disposition of the audited event - *

- */ - public SecurityEvent setEvent(Event theValue) { - myEvent = theValue; - return this; - } - - - /** - * Gets the value(s) for participant (A person, a hardware device or software process). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getParticipant() { - if (myParticipant == null) { - myParticipant = new java.util.ArrayList(); - } - return myParticipant; - } - - /** - * Sets the value(s) for participant (A person, a hardware device or software process) - * - *

- * Definition: - * - *

- */ - public SecurityEvent setParticipant(java.util.List theValue) { - myParticipant = theValue; - return this; - } - - /** - * Adds and returns a new value for participant (A person, a hardware device or software process) - * - *

- * Definition: - * - *

- */ - public Participant addParticipant() { - Participant newType = new Participant(); - getParticipant().add(newType); - return newType; - } - - /** - * Gets the first repetition for participant (A person, a hardware device or software process), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public Participant getParticipantFirstRep() { - if (getParticipant().isEmpty()) { - return addParticipant(); - } - return getParticipant().get(0); - } - - /** - * Gets the value(s) for source (Application systems and processes). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public Source getSource() { - if (mySource == null) { - mySource = new Source(); - } - return mySource; - } - - /** - * Sets the value(s) for source (Application systems and processes) - * - *

- * Definition: - * - *

- */ - public SecurityEvent setSource(Source theValue) { - mySource = theValue; - return this; - } - - - /** - * Gets the value(s) for object (Specific instances of data or objects that have been accessed). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Specific instances of data or objects that have been accessed - *

- */ - public java.util.List getObject() { - if (myObject == null) { - myObject = new java.util.ArrayList(); - } - return myObject; - } - - /** - * Sets the value(s) for object (Specific instances of data or objects that have been accessed) - * - *

- * Definition: - * Specific instances of data or objects that have been accessed - *

- */ - public SecurityEvent setObject(java.util.List theValue) { - myObject = theValue; - return this; - } - - /** - * Adds and returns a new value for object (Specific instances of data or objects that have been accessed) - * - *

- * Definition: - * Specific instances of data or objects that have been accessed - *

- */ - public ObjectElement addObject() { - ObjectElement newType = new ObjectElement(); - getObject().add(newType); - return newType; - } - - /** - * Gets the first repetition for object (Specific instances of data or objects that have been accessed), - * creating it if it does not already exist. - * - *

- * Definition: - * Specific instances of data or objects that have been accessed - *

- */ - public ObjectElement getObjectFirstRep() { - if (getObject().isEmpty()) { - return addObject(); - } - return getObject().get(0); - } - - /** - * Block class for child element: SecurityEvent.event (What was done) - * - *

- * Definition: - * Identifies the name, action type, time, and disposition of the audited event - *

- */ - @Block() - public static class Event extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="type", type=CodeableConceptDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Type/identifier of event", - formalDefinition="Identifier for a family of the event" - ) - private CodeableConceptDt myType; - - @Child(name="subtype", type=CodeableConceptDt.class, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="More specific type/id for the event", - formalDefinition="Identifier for the category of event" - ) - private java.util.List mySubtype; - - @Child(name="action", type=CodeDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Type of action performed during the event", - formalDefinition="Indicator for type of action performed during the event that generated the audit" - ) - private BoundCodeDt myAction; - - @Child(name="dateTime", type=InstantDt.class, order=3, min=1, max=1) - @Description( - shortDefinition="Time when the event occurred on source", - formalDefinition="The time when the event occurred on the source" - ) - private InstantDt myDateTime; - - @Child(name="outcome", type=CodeDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="Whether the event succeeded or failed", - formalDefinition="Indicates whether the event succeeded or failed" - ) - private BoundCodeDt myOutcome; - - @Child(name="outcomeDesc", type=StringDt.class, order=5, min=0, max=1) - @Description( - shortDefinition="Description of the event outcome", - formalDefinition="A free text description of the outcome of the event" - ) - private StringDt myOutcomeDesc; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myType, mySubtype, myAction, myDateTime, myOutcome, myOutcomeDesc); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myType, mySubtype, myAction, myDateTime, myOutcome, myOutcomeDesc); - } - - /** - * Gets the value(s) for type (Type/identifier of event). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifier for a family of the event - *

- */ - public CodeableConceptDt getType() { - if (myType == null) { - myType = new CodeableConceptDt(); - } - return myType; - } - - /** - * Sets the value(s) for type (Type/identifier of event) - * - *

- * Definition: - * Identifier for a family of the event - *

- */ - public Event setType(CodeableConceptDt theValue) { - myType = theValue; - return this; - } - - - /** - * Gets the value(s) for subtype (More specific type/id for the event). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifier for the category of event - *

- */ - public java.util.List getSubtype() { - if (mySubtype == null) { - mySubtype = new java.util.ArrayList(); - } - return mySubtype; - } - - /** - * Sets the value(s) for subtype (More specific type/id for the event) - * - *

- * Definition: - * Identifier for the category of event - *

- */ - public Event setSubtype(java.util.List theValue) { - mySubtype = theValue; - return this; - } - - /** - * Adds and returns a new value for subtype (More specific type/id for the event) - * - *

- * Definition: - * Identifier for the category of event - *

- */ - public CodeableConceptDt addSubtype() { - CodeableConceptDt newType = new CodeableConceptDt(); - getSubtype().add(newType); - return newType; - } - - /** - * Gets the first repetition for subtype (More specific type/id for the event), - * creating it if it does not already exist. - * - *

- * Definition: - * Identifier for the category of event - *

- */ - public CodeableConceptDt getSubtypeFirstRep() { - if (getSubtype().isEmpty()) { - return addSubtype(); - } - return getSubtype().get(0); - } - - /** - * Gets the value(s) for action (Type of action performed during the event). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicator for type of action performed during the event that generated the audit - *

- */ - public BoundCodeDt getAction() { - if (myAction == null) { - myAction = new BoundCodeDt(SecurityEventActionEnum.VALUESET_BINDER); - } - return myAction; - } - - /** - * Sets the value(s) for action (Type of action performed during the event) - * - *

- * Definition: - * Indicator for type of action performed during the event that generated the audit - *

- */ - public Event setAction(BoundCodeDt theValue) { - myAction = theValue; - return this; - } - - /** - * Sets the value(s) for action (Type of action performed during the event) - * - *

- * Definition: - * Indicator for type of action performed during the event that generated the audit - *

- */ - public Event setAction(SecurityEventActionEnum theValue) { - getAction().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for dateTime (Time when the event occurred on source). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The time when the event occurred on the source - *

- */ - public InstantDt getDateTime() { - if (myDateTime == null) { - myDateTime = new InstantDt(); - } - return myDateTime; - } - - /** - * Sets the value(s) for dateTime (Time when the event occurred on source) - * - *

- * Definition: - * The time when the event occurred on the source - *

- */ - public Event setDateTime(InstantDt theValue) { - myDateTime = theValue; - return this; - } - - /** - * Sets the value for dateTime (Time when the event occurred on source) - * - *

- * Definition: - * The time when the event occurred on the source - *

- */ - public Event setDateTime( Date theDate, TemporalPrecisionEnum thePrecision) { - myDateTime = new InstantDt(theDate, thePrecision); - return this; - } - - /** - * Sets the value for dateTime (Time when the event occurred on source) - * - *

- * Definition: - * The time when the event occurred on the source - *

- */ - public Event setDateTimeWithMillisPrecision( Date theDate) { - myDateTime = new InstantDt(theDate); - return this; - } - - - /** - * Gets the value(s) for outcome (Whether the event succeeded or failed). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates whether the event succeeded or failed - *

- */ - public BoundCodeDt getOutcome() { - if (myOutcome == null) { - myOutcome = new BoundCodeDt(SecurityEventOutcomeEnum.VALUESET_BINDER); - } - return myOutcome; - } - - /** - * Sets the value(s) for outcome (Whether the event succeeded or failed) - * - *

- * Definition: - * Indicates whether the event succeeded or failed - *

- */ - public Event setOutcome(BoundCodeDt theValue) { - myOutcome = theValue; - return this; - } - - /** - * Sets the value(s) for outcome (Whether the event succeeded or failed) - * - *

- * Definition: - * Indicates whether the event succeeded or failed - *

- */ - public Event setOutcome(SecurityEventOutcomeEnum theValue) { - getOutcome().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for outcomeDesc (Description of the event outcome). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A free text description of the outcome of the event - *

- */ - public StringDt getOutcomeDesc() { - if (myOutcomeDesc == null) { - myOutcomeDesc = new StringDt(); - } - return myOutcomeDesc; - } - - /** - * Sets the value(s) for outcomeDesc (Description of the event outcome) - * - *

- * Definition: - * A free text description of the outcome of the event - *

- */ - public Event setOutcomeDesc(StringDt theValue) { - myOutcomeDesc = theValue; - return this; - } - - /** - * Sets the value for outcomeDesc (Description of the event outcome) - * - *

- * Definition: - * A free text description of the outcome of the event - *

- */ - public Event setOutcomeDesc( String theString) { - myOutcomeDesc = new StringDt(theString); - return this; - } - - - - } - - - /** - * Block class for child element: SecurityEvent.participant (A person, a hardware device or software process) - * - *

- * Definition: - * - *

- */ - @Block() - public static class Participant extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="role", type=CodeableConceptDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="User roles (e.g. local RBAC codes)", - formalDefinition="Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context" - ) - private java.util.List myRole; - - @Child(name="reference", order=1, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.Device.class }) - @Description( - shortDefinition="Direct reference to resource", - formalDefinition="Direct reference to a resource that identifies the participant" - ) - private ResourceReferenceDt myReference; - - @Child(name="userId", type=StringDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Unique identifier for the user", - formalDefinition="Unique identifier for the user actively participating in the event" - ) - private StringDt myUserId; - - @Child(name="altId", type=StringDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Alternative User id e.g. authentication", - formalDefinition="Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available" - ) - private StringDt myAltId; - - @Child(name="name", type=StringDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="Human-meaningful name for the user", - formalDefinition="Human-meaningful name for the user" - ) - private StringDt myName; - - @Child(name="requestor", type=BooleanDt.class, order=5, min=1, max=1) - @Description( - shortDefinition="Whether user is initiator", - formalDefinition="Indicator that the user is or is not the requestor, or initiator, for the event being audited." - ) - private BooleanDt myRequestor; - - @Child(name="media", type=CodingDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="Type of media", - formalDefinition="Type of media involved. Used when the event is about exporting/importing onto media" - ) - private CodingDt myMedia; - - @Child(name="network", order=7, min=0, max=1) - @Description( - shortDefinition="Logical network location for application activity", - formalDefinition="Logical network location for application activity, if the activity has a network location" - ) - private ParticipantNetwork myNetwork; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myRole, myReference, myUserId, myAltId, myName, myRequestor, myMedia, myNetwork); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myRole, myReference, myUserId, myAltId, myName, myRequestor, myMedia, myNetwork); - } - - /** - * Gets the value(s) for role (User roles (e.g. local RBAC codes)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context - *

- */ - public java.util.List getRole() { - if (myRole == null) { - myRole = new java.util.ArrayList(); - } - return myRole; - } - - /** - * Sets the value(s) for role (User roles (e.g. local RBAC codes)) - * - *

- * Definition: - * Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context - *

- */ - public Participant setRole(java.util.List theValue) { - myRole = theValue; - return this; - } - - /** - * Adds and returns a new value for role (User roles (e.g. local RBAC codes)) - * - *

- * Definition: - * Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context - *

- */ - public CodeableConceptDt addRole() { - CodeableConceptDt newType = new CodeableConceptDt(); - getRole().add(newType); - return newType; - } - - /** - * Gets the first repetition for role (User roles (e.g. local RBAC codes)), - * creating it if it does not already exist. - * - *

- * Definition: - * Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context - *

- */ - public CodeableConceptDt getRoleFirstRep() { - if (getRole().isEmpty()) { - return addRole(); - } - return getRole().get(0); - } - - /** - * Gets the value(s) for reference (Direct reference to resource). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Direct reference to a resource that identifies the participant - *

- */ - public ResourceReferenceDt getReference() { - if (myReference == null) { - myReference = new ResourceReferenceDt(); - } - return myReference; - } - - /** - * Sets the value(s) for reference (Direct reference to resource) - * - *

- * Definition: - * Direct reference to a resource that identifies the participant - *

- */ - public Participant setReference(ResourceReferenceDt theValue) { - myReference = theValue; - return this; - } - - - /** - * Gets the value(s) for userId (Unique identifier for the user). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Unique identifier for the user actively participating in the event - *

- */ - public StringDt getUserId() { - if (myUserId == null) { - myUserId = new StringDt(); - } - return myUserId; - } - - /** - * Sets the value(s) for userId (Unique identifier for the user) - * - *

- * Definition: - * Unique identifier for the user actively participating in the event - *

- */ - public Participant setUserId(StringDt theValue) { - myUserId = theValue; - return this; - } - - /** - * Sets the value for userId (Unique identifier for the user) - * - *

- * Definition: - * Unique identifier for the user actively participating in the event - *

- */ - public Participant setUserId( String theString) { - myUserId = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for altId (Alternative User id e.g. authentication). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available - *

- */ - public StringDt getAltId() { - if (myAltId == null) { - myAltId = new StringDt(); - } - return myAltId; - } - - /** - * Sets the value(s) for altId (Alternative User id e.g. authentication) - * - *

- * Definition: - * Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available - *

- */ - public Participant setAltId(StringDt theValue) { - myAltId = theValue; - return this; - } - - /** - * Sets the value for altId (Alternative User id e.g. authentication) - * - *

- * Definition: - * Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available - *

- */ - public Participant setAltId( String theString) { - myAltId = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for name (Human-meaningful name for the user). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Human-meaningful name for the user - *

- */ - public StringDt getName() { - if (myName == null) { - myName = new StringDt(); - } - return myName; - } - - /** - * Sets the value(s) for name (Human-meaningful name for the user) - * - *

- * Definition: - * Human-meaningful name for the user - *

- */ - public Participant setName(StringDt theValue) { - myName = theValue; - return this; - } - - /** - * Sets the value for name (Human-meaningful name for the user) - * - *

- * Definition: - * Human-meaningful name for the user - *

- */ - public Participant setName( String theString) { - myName = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for requestor (Whether user is initiator). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicator that the user is or is not the requestor, or initiator, for the event being audited. - *

- */ - public BooleanDt getRequestor() { - if (myRequestor == null) { - myRequestor = new BooleanDt(); - } - return myRequestor; - } - - /** - * Sets the value(s) for requestor (Whether user is initiator) - * - *

- * Definition: - * Indicator that the user is or is not the requestor, or initiator, for the event being audited. - *

- */ - public Participant setRequestor(BooleanDt theValue) { - myRequestor = theValue; - return this; - } - - /** - * Sets the value for requestor (Whether user is initiator) - * - *

- * Definition: - * Indicator that the user is or is not the requestor, or initiator, for the event being audited. - *

- */ - public Participant setRequestor( boolean theBoolean) { - myRequestor = new BooleanDt(theBoolean); - return this; - } - - - /** - * Gets the value(s) for media (Type of media). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Type of media involved. Used when the event is about exporting/importing onto media - *

- */ - public CodingDt getMedia() { - if (myMedia == null) { - myMedia = new CodingDt(); - } - return myMedia; - } - - /** - * Sets the value(s) for media (Type of media) - * - *

- * Definition: - * Type of media involved. Used when the event is about exporting/importing onto media - *

- */ - public Participant setMedia(CodingDt theValue) { - myMedia = theValue; - return this; - } - - - /** - * Gets the value(s) for network (Logical network location for application activity). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Logical network location for application activity, if the activity has a network location - *

- */ - public ParticipantNetwork getNetwork() { - if (myNetwork == null) { - myNetwork = new ParticipantNetwork(); - } - return myNetwork; - } - - /** - * Sets the value(s) for network (Logical network location for application activity) - * - *

- * Definition: - * Logical network location for application activity, if the activity has a network location - *

- */ - public Participant setNetwork(ParticipantNetwork theValue) { - myNetwork = theValue; - return this; - } - - - - } - - /** - * Block class for child element: SecurityEvent.participant.network (Logical network location for application activity) - * - *

- * Definition: - * Logical network location for application activity, if the activity has a network location - *

- */ - @Block() - public static class ParticipantNetwork extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="identifier", type=StringDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Identifier for the network access point of the user device", - formalDefinition="An identifier for the network access point of the user device for the audit event" - ) - private StringDt myIdentifier; - - @Child(name="type", type=CodeDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="The type of network access point", - formalDefinition="An identifier for the type of network access point that originated the audit event" - ) - private BoundCodeDt myType; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myType); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myType); - } - - /** - * Gets the value(s) for identifier (Identifier for the network access point of the user device). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * An identifier for the network access point of the user device for the audit event - *

- */ - public StringDt getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new StringDt(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Identifier for the network access point of the user device) - * - *

- * Definition: - * An identifier for the network access point of the user device for the audit event - *

- */ - public ParticipantNetwork setIdentifier(StringDt theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Sets the value for identifier (Identifier for the network access point of the user device) - * - *

- * Definition: - * An identifier for the network access point of the user device for the audit event - *

- */ - public ParticipantNetwork setIdentifier( String theString) { - myIdentifier = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for type (The type of network access point). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * An identifier for the type of network access point that originated the audit event - *

- */ - public BoundCodeDt getType() { - if (myType == null) { - myType = new BoundCodeDt(SecurityEventParticipantNetworkTypeEnum.VALUESET_BINDER); - } - return myType; - } - - /** - * Sets the value(s) for type (The type of network access point) - * - *

- * Definition: - * An identifier for the type of network access point that originated the audit event - *

- */ - public ParticipantNetwork setType(BoundCodeDt theValue) { - myType = theValue; - return this; - } - - /** - * Sets the value(s) for type (The type of network access point) - * - *

- * Definition: - * An identifier for the type of network access point that originated the audit event - *

- */ - public ParticipantNetwork setType(SecurityEventParticipantNetworkTypeEnum theValue) { - getType().setValueAsEnum(theValue); - return this; - } - - - - } - - - - /** - * Block class for child element: SecurityEvent.source (Application systems and processes) - * - *

- * Definition: - * - *

- */ - @Block() - public static class Source extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="site", type=StringDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Logical source location within the enterprise", - formalDefinition="Logical source location within the healthcare enterprise network" - ) - private StringDt mySite; - - @Child(name="identifier", type=StringDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="The id of source where event originated", - formalDefinition="Identifier of the source where the event originated" - ) - private StringDt myIdentifier; - - @Child(name="type", type=CodingDt.class, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="The type of source where event originated", - formalDefinition="Code specifying the type of source where event originated" - ) - private java.util.List myType; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySite, myIdentifier, myType); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySite, myIdentifier, myType); - } - - /** - * Gets the value(s) for site (Logical source location within the enterprise). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Logical source location within the healthcare enterprise network - *

- */ - public StringDt getSite() { - if (mySite == null) { - mySite = new StringDt(); - } - return mySite; - } - - /** - * Sets the value(s) for site (Logical source location within the enterprise) - * - *

- * Definition: - * Logical source location within the healthcare enterprise network - *

- */ - public Source setSite(StringDt theValue) { - mySite = theValue; - return this; - } - - /** - * Sets the value for site (Logical source location within the enterprise) - * - *

- * Definition: - * Logical source location within the healthcare enterprise network - *

- */ - public Source setSite( String theString) { - mySite = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for identifier (The id of source where event originated). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifier of the source where the event originated - *

- */ - public StringDt getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new StringDt(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (The id of source where event originated) - * - *

- * Definition: - * Identifier of the source where the event originated - *

- */ - public Source setIdentifier(StringDt theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Sets the value for identifier (The id of source where event originated) - * - *

- * Definition: - * Identifier of the source where the event originated - *

- */ - public Source setIdentifier( String theString) { - myIdentifier = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for type (The type of source where event originated). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Code specifying the type of source where event originated - *

- */ - public java.util.List getType() { - if (myType == null) { - myType = new java.util.ArrayList(); - } - return myType; - } - - /** - * Sets the value(s) for type (The type of source where event originated) - * - *

- * Definition: - * Code specifying the type of source where event originated - *

- */ - public Source setType(java.util.List theValue) { - myType = theValue; - return this; - } - - /** - * Adds and returns a new value for type (The type of source where event originated) - * - *

- * Definition: - * Code specifying the type of source where event originated - *

- */ - public CodingDt addType() { - CodingDt newType = new CodingDt(); - getType().add(newType); - return newType; - } - - /** - * Gets the first repetition for type (The type of source where event originated), - * creating it if it does not already exist. - * - *

- * Definition: - * Code specifying the type of source where event originated - *

- */ - public CodingDt getTypeFirstRep() { - if (getType().isEmpty()) { - return addType(); - } - return getType().get(0); - } - - - } - - - /** - * Block class for child element: SecurityEvent.object (Specific instances of data or objects that have been accessed) - * - *

- * Definition: - * Specific instances of data or objects that have been accessed - *

- */ - @Block() - public static class ObjectElement extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Specific instance of object (e.g. versioned)", - formalDefinition="Identifies a specific instance of the participant object. The reference should always be version specific" - ) - private IdentifierDt myIdentifier; - - @Child(name="reference", order=1, min=0, max=1, type={ - IResource.class }) - @Description( - shortDefinition="Specific instance of resource (e.g. versioned)", - formalDefinition="Identifies a specific instance of the participant object. The reference should always be version specific" - ) - private ResourceReferenceDt myReference; - - @Child(name="type", type=CodeDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Object type being audited", - formalDefinition="Object type being audited" - ) - private BoundCodeDt myType; - - @Child(name="role", type=CodeDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Functional application role of Object", - formalDefinition="Code representing the functional application role of Participant Object being audited" - ) - private BoundCodeDt myRole; - - @Child(name="lifecycle", type=CodeDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="Life-cycle stage for the object", - formalDefinition="Identifier for the data life-cycle stage for the participant object" - ) - private BoundCodeDt myLifecycle; - - @Child(name="sensitivity", type=CodeableConceptDt.class, order=5, min=0, max=1) - @Description( - shortDefinition="Policy-defined sensitivity for the object", - formalDefinition="Denotes policy-defined sensitivity for the Participant Object ID such as VIP, HIV status, mental health status or similar topics" - ) - private BoundCodeableConceptDt mySensitivity; - - @Child(name="name", type=StringDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="Instance-specific descriptor for Object", - formalDefinition="An instance-specific descriptor of the Participant Object ID audited, such as a person's name" - ) - private StringDt myName; - - @Child(name="description", type=StringDt.class, order=7, min=0, max=1) - @Description( - shortDefinition="Descriptive text", - formalDefinition="Text that describes the object in more detail" - ) - private StringDt myDescription; - - @Child(name="query", type=Base64BinaryDt.class, order=8, min=0, max=1) - @Description( - shortDefinition="Actual query for object", - formalDefinition="The actual query for a query-type participant object" - ) - private Base64BinaryDt myQuery; - - @Child(name="detail", order=9, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Additional Information about the Object", - formalDefinition="" - ) - private java.util.List myDetail; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myReference, myType, myRole, myLifecycle, mySensitivity, myName, myDescription, myQuery, myDetail); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myReference, myType, myRole, myLifecycle, mySensitivity, myName, myDescription, myQuery, myDetail); - } - - /** - * Gets the value(s) for identifier (Specific instance of object (e.g. versioned)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies a specific instance of the participant object. The reference should always be version specific - *

- */ - public IdentifierDt getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new IdentifierDt(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Specific instance of object (e.g. versioned)) - * - *

- * Definition: - * Identifies a specific instance of the participant object. The reference should always be version specific - *

- */ - public ObjectElement setIdentifier(IdentifierDt theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Sets the value for identifier (Specific instance of object (e.g. versioned)) - * - *

- * Definition: - * Identifies a specific instance of the participant object. The reference should always be version specific - *

- */ - public ObjectElement setIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - myIdentifier = new IdentifierDt(theUse, theSystem, theValue, theLabel); - return this; - } - - /** - * Sets the value for identifier (Specific instance of object (e.g. versioned)) - * - *

- * Definition: - * Identifies a specific instance of the participant object. The reference should always be version specific - *

- */ - public ObjectElement setIdentifier( String theSystem, String theValue) { - myIdentifier = new IdentifierDt(theSystem, theValue); - return this; - } - - - /** - * Gets the value(s) for reference (Specific instance of resource (e.g. versioned)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies a specific instance of the participant object. The reference should always be version specific - *

- */ - public ResourceReferenceDt getReference() { - if (myReference == null) { - myReference = new ResourceReferenceDt(); - } - return myReference; - } - - /** - * Sets the value(s) for reference (Specific instance of resource (e.g. versioned)) - * - *

- * Definition: - * Identifies a specific instance of the participant object. The reference should always be version specific - *

- */ - public ObjectElement setReference(ResourceReferenceDt theValue) { - myReference = theValue; - return this; - } - - - /** - * Gets the value(s) for type (Object type being audited). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Object type being audited - *

- */ - public BoundCodeDt getType() { - if (myType == null) { - myType = new BoundCodeDt(SecurityEventObjectTypeEnum.VALUESET_BINDER); - } - return myType; - } - - /** - * Sets the value(s) for type (Object type being audited) - * - *

- * Definition: - * Object type being audited - *

- */ - public ObjectElement setType(BoundCodeDt theValue) { - myType = theValue; - return this; - } - - /** - * Sets the value(s) for type (Object type being audited) - * - *

- * Definition: - * Object type being audited - *

- */ - public ObjectElement setType(SecurityEventObjectTypeEnum theValue) { - getType().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for role (Functional application role of Object). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Code representing the functional application role of Participant Object being audited - *

- */ - public BoundCodeDt getRole() { - if (myRole == null) { - myRole = new BoundCodeDt(SecurityEventObjectRoleEnum.VALUESET_BINDER); - } - return myRole; - } - - /** - * Sets the value(s) for role (Functional application role of Object) - * - *

- * Definition: - * Code representing the functional application role of Participant Object being audited - *

- */ - public ObjectElement setRole(BoundCodeDt theValue) { - myRole = theValue; - return this; - } - - /** - * Sets the value(s) for role (Functional application role of Object) - * - *

- * Definition: - * Code representing the functional application role of Participant Object being audited - *

- */ - public ObjectElement setRole(SecurityEventObjectRoleEnum theValue) { - getRole().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for lifecycle (Life-cycle stage for the object). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifier for the data life-cycle stage for the participant object - *

- */ - public BoundCodeDt getLifecycle() { - if (myLifecycle == null) { - myLifecycle = new BoundCodeDt(SecurityEventObjectLifecycleEnum.VALUESET_BINDER); - } - return myLifecycle; - } - - /** - * Sets the value(s) for lifecycle (Life-cycle stage for the object) - * - *

- * Definition: - * Identifier for the data life-cycle stage for the participant object - *

- */ - public ObjectElement setLifecycle(BoundCodeDt theValue) { - myLifecycle = theValue; - return this; - } - - /** - * Sets the value(s) for lifecycle (Life-cycle stage for the object) - * - *

- * Definition: - * Identifier for the data life-cycle stage for the participant object - *

- */ - public ObjectElement setLifecycle(SecurityEventObjectLifecycleEnum theValue) { - getLifecycle().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for sensitivity (Policy-defined sensitivity for the object). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Denotes policy-defined sensitivity for the Participant Object ID such as VIP, HIV status, mental health status or similar topics - *

- */ - public BoundCodeableConceptDt getSensitivity() { - if (mySensitivity == null) { - mySensitivity = new BoundCodeableConceptDt(SecurityEventObjectSensitivityEnum.VALUESET_BINDER); - } - return mySensitivity; - } - - /** - * Sets the value(s) for sensitivity (Policy-defined sensitivity for the object) - * - *

- * Definition: - * Denotes policy-defined sensitivity for the Participant Object ID such as VIP, HIV status, mental health status or similar topics - *

- */ - public ObjectElement setSensitivity(BoundCodeableConceptDt theValue) { - mySensitivity = theValue; - return this; - } - - /** - * Sets the value(s) for sensitivity (Policy-defined sensitivity for the object) - * - *

- * Definition: - * Denotes policy-defined sensitivity for the Participant Object ID such as VIP, HIV status, mental health status or similar topics - *

- */ - public ObjectElement setSensitivity(SecurityEventObjectSensitivityEnum theValue) { - getSensitivity().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for name (Instance-specific descriptor for Object). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * An instance-specific descriptor of the Participant Object ID audited, such as a person's name - *

- */ - public StringDt getName() { - if (myName == null) { - myName = new StringDt(); - } - return myName; - } - - /** - * Sets the value(s) for name (Instance-specific descriptor for Object) - * - *

- * Definition: - * An instance-specific descriptor of the Participant Object ID audited, such as a person's name - *

- */ - public ObjectElement setName(StringDt theValue) { - myName = theValue; - return this; - } - - /** - * Sets the value for name (Instance-specific descriptor for Object) - * - *

- * Definition: - * An instance-specific descriptor of the Participant Object ID audited, such as a person's name - *

- */ - public ObjectElement setName( String theString) { - myName = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for description (Descriptive text). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Text that describes the object in more detail - *

- */ - public StringDt getDescription() { - if (myDescription == null) { - myDescription = new StringDt(); - } - return myDescription; - } - - /** - * Sets the value(s) for description (Descriptive text) - * - *

- * Definition: - * Text that describes the object in more detail - *

- */ - public ObjectElement setDescription(StringDt theValue) { - myDescription = theValue; - return this; - } - - /** - * Sets the value for description (Descriptive text) - * - *

- * Definition: - * Text that describes the object in more detail - *

- */ - public ObjectElement setDescription( String theString) { - myDescription = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for query (Actual query for object). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The actual query for a query-type participant object - *

- */ - public Base64BinaryDt getQuery() { - if (myQuery == null) { - myQuery = new Base64BinaryDt(); - } - return myQuery; - } - - /** - * Sets the value(s) for query (Actual query for object) - * - *

- * Definition: - * The actual query for a query-type participant object - *

- */ - public ObjectElement setQuery(Base64BinaryDt theValue) { - myQuery = theValue; - return this; - } - - /** - * Sets the value for query (Actual query for object) - * - *

- * Definition: - * The actual query for a query-type participant object - *

- */ - public ObjectElement setQuery( byte[] theBytes) { - myQuery = new Base64BinaryDt(theBytes); - return this; - } - - - /** - * Gets the value(s) for detail (Additional Information about the Object). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getDetail() { - if (myDetail == null) { - myDetail = new java.util.ArrayList(); - } - return myDetail; - } - - /** - * Sets the value(s) for detail (Additional Information about the Object) - * - *

- * Definition: - * - *

- */ - public ObjectElement setDetail(java.util.List theValue) { - myDetail = theValue; - return this; - } - - /** - * Adds and returns a new value for detail (Additional Information about the Object) - * - *

- * Definition: - * - *

- */ - public ObjectDetail addDetail() { - ObjectDetail newType = new ObjectDetail(); - getDetail().add(newType); - return newType; - } - - /** - * Gets the first repetition for detail (Additional Information about the Object), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public ObjectDetail getDetailFirstRep() { - if (getDetail().isEmpty()) { - return addDetail(); - } - return getDetail().get(0); - } - - - } - - /** - * Block class for child element: SecurityEvent.object.detail (Additional Information about the Object) - * - *

- * Definition: - * - *

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

- * Definition: - * - *

- */ - public StringDt getType() { - if (myType == null) { - myType = new StringDt(); - } - return myType; - } - - /** - * Sets the value(s) for type (Name of the property) - * - *

- * Definition: - * - *

- */ - public ObjectDetail setType(StringDt theValue) { - myType = theValue; - return this; - } - - /** - * Sets the value for type (Name of the property) - * - *

- * Definition: - * - *

- */ - public ObjectDetail setType( String theString) { - myType = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for value (Property value). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public Base64BinaryDt getValue() { - if (myValue == null) { - myValue = new Base64BinaryDt(); - } - return myValue; - } - - /** - * Sets the value(s) for value (Property value) - * - *

- * Definition: - * - *

- */ - public ObjectDetail setValue(Base64BinaryDt theValue) { - myValue = theValue; - return this; - } - - /** - * Sets the value for value (Property value) - * - *

- * Definition: - * - *

- */ - public ObjectDetail setValue( byte[] theBytes) { - myValue = new Base64BinaryDt(theBytes); - return this; - } - - - - } - - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SequencingAnalysis.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SequencingAnalysis.java deleted file mode 100644 index df47230fdf8..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SequencingAnalysis.java +++ /dev/null @@ -1,662 +0,0 @@ - - - - - - - - - - - - - - - - -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.dstu.composite.AttachmentDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.DateDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.rest.gclient.DateClientParam; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.StringClientParam; - - -/** - * HAPI/FHIR SequencingAnalysis Resource - * (Sequencing Analysis) - * - *

- * Definition: - * Computational analysis on a patient's genetic raw file - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/SequencingAnalysis - *

- * - */ -@ResourceDef(name="SequencingAnalysis", profile="http://hl7.org/fhir/profiles/SequencingAnalysis", id="sequencinganalysis") -public class SequencingAnalysis extends BaseResource implements IResource { - - /** - * Search parameter constant for subject - *

- * Description: Subject of the analysis
- * Type: reference
- * Path: SequencingAnalysis.subject
- *

- */ - @SearchParamDefinition(name="subject", path="SequencingAnalysis.subject", description="Subject of the analysis", type="reference" ) - public static final String SP_SUBJECT = "subject"; - - /** - * Fluent Client search parameter constant for subject - *

- * Description: Subject of the analysis
- * Type: reference
- * Path: SequencingAnalysis.subject
- *

- */ - public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "SequencingAnalysis.subject". - */ - public static final Include INCLUDE_SUBJECT = new Include("SequencingAnalysis.subject"); - - /** - * Search parameter constant for date - *

- * Description: Date when result of the analysis is updated
- * Type: date
- * Path: SequencingAnalysis.date
- *

- */ - @SearchParamDefinition(name="date", path="SequencingAnalysis.date", description="Date when result of the analysis is updated", type="date" ) - public static final String SP_DATE = "date"; - - /** - * Fluent Client search parameter constant for date - *

- * Description: Date when result of the analysis is updated
- * Type: date
- * Path: SequencingAnalysis.date
- *

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

- * Description: Name of the reference genome used in the analysis
- * Type: string
- * Path: SequencingAnalysis.genome.name
- *

- */ - @SearchParamDefinition(name="genome", path="SequencingAnalysis.genome.name", description="Name of the reference genome used in the analysis", type="string" ) - public static final String SP_GENOME = "genome"; - - /** - * Fluent Client search parameter constant for genome - *

- * Description: Name of the reference genome used in the analysis
- * Type: string
- * Path: SequencingAnalysis.genome.name
- *

- */ - public static final StringClientParam GENOME = new StringClientParam(SP_GENOME); - - - @Child(name="subject", order=0, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="Subject", - formalDefinition="Subject of the analysis" - ) - private ResourceReferenceDt mySubject; - - @Child(name="date", type=DateDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="Date", - formalDefinition="Date when result of the analysis is updated" - ) - private DateDt myDate; - - @Child(name="name", type=StringDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="Name", - formalDefinition="Name of the analysis" - ) - private StringDt myName; - - @Child(name="genome", order=3, min=1, max=1) - @Description( - shortDefinition="Reference genome", - formalDefinition="Reference genome used in the analysis" - ) - private Genome myGenome; - - @Child(name="file", type=AttachmentDt.class, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="File", - formalDefinition="Files uploaded as result of the analysis" - ) - private java.util.List myFile; - - @Child(name="inputLab", order=5, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.SequencingLab.class }) - @Description( - shortDefinition="Input lab", - formalDefinition="SequencingLab taken into account of the analysis" - ) - private java.util.List myInputLab; - - @Child(name="inputAnalysis", order=6, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.SequencingAnalysis.class }) - @Description( - shortDefinition="Input analysis", - formalDefinition="SequencingAnalysis taken into account of the analysis" - ) - private java.util.List myInputAnalysis; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySubject, myDate, myName, myGenome, myFile, myInputLab, myInputAnalysis); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySubject, myDate, myName, myGenome, myFile, myInputLab, myInputAnalysis); - } - - /** - * Gets the value(s) for subject (Subject). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Subject of the analysis - *

- */ - public ResourceReferenceDt getSubject() { - if (mySubject == null) { - mySubject = new ResourceReferenceDt(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (Subject) - * - *

- * Definition: - * Subject of the analysis - *

- */ - public SequencingAnalysis setSubject(ResourceReferenceDt theValue) { - mySubject = theValue; - return this; - } - - - /** - * Gets the value(s) for date (Date). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Date when result of the analysis is updated - *

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

- * Definition: - * Date when result of the analysis is updated - *

- */ - public SequencingAnalysis setDate(DateDt theValue) { - myDate = theValue; - return this; - } - - /** - * Sets the value for date (Date) - * - *

- * Definition: - * Date when result of the analysis is updated - *

- */ - public SequencingAnalysis setDateWithDayPrecision( Date theDate) { - myDate = new DateDt(theDate); - return this; - } - - /** - * Sets the value for date (Date) - * - *

- * Definition: - * Date when result of the analysis is updated - *

- */ - public SequencingAnalysis setDate( Date theDate, TemporalPrecisionEnum thePrecision) { - myDate = new DateDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for name (Name). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Name of the analysis - *

- */ - public StringDt getName() { - if (myName == null) { - myName = new StringDt(); - } - return myName; - } - - /** - * Sets the value(s) for name (Name) - * - *

- * Definition: - * Name of the analysis - *

- */ - public SequencingAnalysis setName(StringDt theValue) { - myName = theValue; - return this; - } - - /** - * Sets the value for name (Name) - * - *

- * Definition: - * Name of the analysis - *

- */ - public SequencingAnalysis setName( String theString) { - myName = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for genome (Reference genome). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Reference genome used in the analysis - *

- */ - public Genome getGenome() { - if (myGenome == null) { - myGenome = new Genome(); - } - return myGenome; - } - - /** - * Sets the value(s) for genome (Reference genome) - * - *

- * Definition: - * Reference genome used in the analysis - *

- */ - public SequencingAnalysis setGenome(Genome theValue) { - myGenome = theValue; - return this; - } - - - /** - * Gets the value(s) for file (File). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Files uploaded as result of the analysis - *

- */ - public java.util.List getFile() { - if (myFile == null) { - myFile = new java.util.ArrayList(); - } - return myFile; - } - - /** - * Sets the value(s) for file (File) - * - *

- * Definition: - * Files uploaded as result of the analysis - *

- */ - public SequencingAnalysis setFile(java.util.List theValue) { - myFile = theValue; - return this; - } - - /** - * Adds and returns a new value for file (File) - * - *

- * Definition: - * Files uploaded as result of the analysis - *

- */ - public AttachmentDt addFile() { - AttachmentDt newType = new AttachmentDt(); - getFile().add(newType); - return newType; - } - - /** - * Gets the first repetition for file (File), - * creating it if it does not already exist. - * - *

- * Definition: - * Files uploaded as result of the analysis - *

- */ - public AttachmentDt getFileFirstRep() { - if (getFile().isEmpty()) { - return addFile(); - } - return getFile().get(0); - } - - /** - * Gets the value(s) for inputLab (Input lab). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * SequencingLab taken into account of the analysis - *

- */ - public java.util.List getInputLab() { - if (myInputLab == null) { - myInputLab = new java.util.ArrayList(); - } - return myInputLab; - } - - /** - * Sets the value(s) for inputLab (Input lab) - * - *

- * Definition: - * SequencingLab taken into account of the analysis - *

- */ - public SequencingAnalysis setInputLab(java.util.List theValue) { - myInputLab = theValue; - return this; - } - - /** - * Adds and returns a new value for inputLab (Input lab) - * - *

- * Definition: - * SequencingLab taken into account of the analysis - *

- */ - public ResourceReferenceDt addInputLab() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getInputLab().add(newType); - return newType; - } - - /** - * Gets the value(s) for inputAnalysis (Input analysis). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * SequencingAnalysis taken into account of the analysis - *

- */ - public java.util.List getInputAnalysis() { - if (myInputAnalysis == null) { - myInputAnalysis = new java.util.ArrayList(); - } - return myInputAnalysis; - } - - /** - * Sets the value(s) for inputAnalysis (Input analysis) - * - *

- * Definition: - * SequencingAnalysis taken into account of the analysis - *

- */ - public SequencingAnalysis setInputAnalysis(java.util.List theValue) { - myInputAnalysis = theValue; - return this; - } - - /** - * Adds and returns a new value for inputAnalysis (Input analysis) - * - *

- * Definition: - * SequencingAnalysis taken into account of the analysis - *

- */ - public ResourceReferenceDt addInputAnalysis() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getInputAnalysis().add(newType); - return newType; - } - - /** - * Block class for child element: SequencingAnalysis.genome (Reference genome) - * - *

- * Definition: - * Reference genome used in the analysis - *

- */ - @Block() - public static class Genome extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="name", type=CodeDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Name", - formalDefinition="Name of the reference genome" - ) - private CodeDt myName; - - @Child(name="build", type=StringDt.class, order=1, min=1, max=1) - @Description( - shortDefinition="Build", - formalDefinition="Build number of the refernece genome" - ) - private StringDt myBuild; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myName, myBuild); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myName, myBuild); - } - - /** - * Gets the value(s) for name (Name). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Name of the reference genome - *

- */ - public CodeDt getName() { - if (myName == null) { - myName = new CodeDt(); - } - return myName; - } - - /** - * Sets the value(s) for name (Name) - * - *

- * Definition: - * Name of the reference genome - *

- */ - public Genome setName(CodeDt theValue) { - myName = theValue; - return this; - } - - /** - * Sets the value for name (Name) - * - *

- * Definition: - * Name of the reference genome - *

- */ - public Genome setName( String theCode) { - myName = new CodeDt(theCode); - return this; - } - - - /** - * Gets the value(s) for build (Build). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Build number of the refernece genome - *

- */ - public StringDt getBuild() { - if (myBuild == null) { - myBuild = new StringDt(); - } - return myBuild; - } - - /** - * Sets the value(s) for build (Build) - * - *

- * Definition: - * Build number of the refernece genome - *

- */ - public Genome setBuild(StringDt theValue) { - myBuild = theValue; - return this; - } - - /** - * Sets the value for build (Build) - * - *

- * Definition: - * Build number of the refernece genome - *

- */ - public Genome setBuild( String theString) { - myBuild = new StringDt(theString); - return this; - } - - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SequencingLab.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SequencingLab.java deleted file mode 100644 index d22719b8f29..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SequencingLab.java +++ /dev/null @@ -1,979 +0,0 @@ - - - - - - - - - - - - - - - - -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.dstu.composite.AttachmentDt; -import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.DateDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.rest.gclient.DateClientParam; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.StringClientParam; - - -/** - * HAPI/FHIR SequencingLab Resource - * (Sequencing Lab) - * - *

- * Definition: - * A lab for sequencing - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/SequencingLab - *

- * - */ -@ResourceDef(name="SequencingLab", profile="http://hl7.org/fhir/profiles/SequencingLab", id="sequencinglab") -public class SequencingLab extends BaseResource implements IResource { - - /** - * Search parameter constant for subject - *

- * Description: Subject of the lab
- * Type: reference
- * Path: SequencingLab.subject
- *

- */ - @SearchParamDefinition(name="subject", path="SequencingLab.subject", description="Subject of the lab", type="reference" ) - public static final String SP_SUBJECT = "subject"; - - /** - * Fluent Client search parameter constant for subject - *

- * Description: Subject of the lab
- * Type: reference
- * Path: SequencingLab.subject
- *

- */ - public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "SequencingLab.subject". - */ - public static final Include INCLUDE_SUBJECT = new Include("SequencingLab.subject"); - - /** - * Search parameter constant for specimen - *

- * Description: Type of the specimen used for the lab
- * Type: string
- * Path: SequencingLab.specimen.type
- *

- */ - @SearchParamDefinition(name="specimen", path="SequencingLab.specimen.type", description="Type of the specimen used for the lab", type="string" ) - public static final String SP_SPECIMEN = "specimen"; - - /** - * Fluent Client search parameter constant for specimen - *

- * Description: Type of the specimen used for the lab
- * Type: string
- * Path: SequencingLab.specimen.type
- *

- */ - public static final StringClientParam SPECIMEN = new StringClientParam(SP_SPECIMEN); - - /** - * Search parameter constant for date - *

- * Description: Date when result of the lab is uploaded
- * Type: date
- * Path: SequencingLab.date
- *

- */ - @SearchParamDefinition(name="date", path="SequencingLab.date", description="Date when result of the lab is uploaded", type="date" ) - public static final String SP_DATE = "date"; - - /** - * Fluent Client search parameter constant for date - *

- * Description: Date when result of the lab is uploaded
- * Type: date
- * Path: SequencingLab.date
- *

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

- * Description: Organization that does the lab
- * Type: string
- * Path: SequencingLab.organization
- *

- */ - @SearchParamDefinition(name="organization", path="SequencingLab.organization", description="Organization that does the lab", type="string" ) - public static final String SP_ORGANIZATION = "organization"; - - /** - * Fluent Client search parameter constant for organization - *

- * Description: Organization that does the lab
- * Type: string
- * Path: SequencingLab.organization
- *

- */ - public static final StringClientParam ORGANIZATION = new StringClientParam(SP_ORGANIZATION); - - /** - * Search parameter constant for system-class - *

- * Description: Class of the sequencing system
- * Type: string
- * Path: SequencingLab.system.class
- *

- */ - @SearchParamDefinition(name="system-class", path="SequencingLab.system.class", description="Class of the sequencing system", type="string" ) - public static final String SP_SYSTEM_CLASS = "system-class"; - - /** - * Fluent Client search parameter constant for system-class - *

- * Description: Class of the sequencing system
- * Type: string
- * Path: SequencingLab.system.class
- *

- */ - public static final StringClientParam SYSTEM_CLASS = new StringClientParam(SP_SYSTEM_CLASS); - - /** - * Search parameter constant for system-name - *

- * Description: Name of the sequencing system
- * Type: string
- * Path: SequencingLab.system.name
- *

- */ - @SearchParamDefinition(name="system-name", path="SequencingLab.system.name", description="Name of the sequencing system", type="string" ) - public static final String SP_SYSTEM_NAME = "system-name"; - - /** - * Fluent Client search parameter constant for system-name - *

- * Description: Name of the sequencing system
- * Type: string
- * Path: SequencingLab.system.name
- *

- */ - public static final StringClientParam SYSTEM_NAME = new StringClientParam(SP_SYSTEM_NAME); - - - @Child(name="subject", order=0, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="Subject", - formalDefinition="Subject of the sequencing lab" - ) - private ResourceReferenceDt mySubject; - - @Child(name="organization", type=StringDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Organization", - formalDefinition="Organization that does the sequencing" - ) - private StringDt myOrganization; - - @Child(name="name", type=StringDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="Name", - formalDefinition="Name of the lab" - ) - private StringDt myName; - - @Child(name="date", type=DateDt.class, order=3, min=1, max=1) - @Description( - shortDefinition="Date", - formalDefinition="Date when the result of the lab is uploaded" - ) - private DateDt myDate; - - @Child(name="type", type=CodeDt.class, order=4, min=1, max=1) - @Description( - shortDefinition="Type", - formalDefinition="Type of the sequencing lab" - ) - private CodeDt myType; - - @Child(name="system", order=5, min=0, max=1) - @Description( - shortDefinition="Sequencing System", - formalDefinition="System of machine used for sequencing" - ) - private System mySystem; - - @Child(name="specimen", order=6, min=1, max=1) - @Description( - shortDefinition="Specimen of the lab", - formalDefinition="Specimen of the lab" - ) - private Specimen mySpecimen; - - @Child(name="file", type=AttachmentDt.class, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="File", - formalDefinition="Files uploaded as results of the lab" - ) - private java.util.List myFile; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySubject, myOrganization, myName, myDate, myType, mySystem, mySpecimen, myFile); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySubject, myOrganization, myName, myDate, myType, mySystem, mySpecimen, myFile); - } - - /** - * Gets the value(s) for subject (Subject). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Subject of the sequencing lab - *

- */ - public ResourceReferenceDt getSubject() { - if (mySubject == null) { - mySubject = new ResourceReferenceDt(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (Subject) - * - *

- * Definition: - * Subject of the sequencing lab - *

- */ - public SequencingLab setSubject(ResourceReferenceDt theValue) { - mySubject = theValue; - return this; - } - - - /** - * Gets the value(s) for organization (Organization). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Organization that does the sequencing - *

- */ - public StringDt getOrganization() { - if (myOrganization == null) { - myOrganization = new StringDt(); - } - return myOrganization; - } - - /** - * Sets the value(s) for organization (Organization) - * - *

- * Definition: - * Organization that does the sequencing - *

- */ - public SequencingLab setOrganization(StringDt theValue) { - myOrganization = theValue; - return this; - } - - /** - * Sets the value for organization (Organization) - * - *

- * Definition: - * Organization that does the sequencing - *

- */ - public SequencingLab setOrganization( String theString) { - myOrganization = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for name (Name). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Name of the lab - *

- */ - public StringDt getName() { - if (myName == null) { - myName = new StringDt(); - } - return myName; - } - - /** - * Sets the value(s) for name (Name) - * - *

- * Definition: - * Name of the lab - *

- */ - public SequencingLab setName(StringDt theValue) { - myName = theValue; - return this; - } - - /** - * Sets the value for name (Name) - * - *

- * Definition: - * Name of the lab - *

- */ - public SequencingLab setName( String theString) { - myName = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for date (Date). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Date when the result of the lab is uploaded - *

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

- * Definition: - * Date when the result of the lab is uploaded - *

- */ - public SequencingLab setDate(DateDt theValue) { - myDate = theValue; - return this; - } - - /** - * Sets the value for date (Date) - * - *

- * Definition: - * Date when the result of the lab is uploaded - *

- */ - public SequencingLab setDateWithDayPrecision( Date theDate) { - myDate = new DateDt(theDate); - return this; - } - - /** - * Sets the value for date (Date) - * - *

- * Definition: - * Date when the result of the lab is uploaded - *

- */ - public SequencingLab setDate( Date theDate, TemporalPrecisionEnum thePrecision) { - myDate = new DateDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for type (Type). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Type of the sequencing lab - *

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

- * Definition: - * Type of the sequencing lab - *

- */ - public SequencingLab setType(CodeDt theValue) { - myType = theValue; - return this; - } - - /** - * Sets the value for type (Type) - * - *

- * Definition: - * Type of the sequencing lab - *

- */ - public SequencingLab setType( String theCode) { - myType = new CodeDt(theCode); - return this; - } - - - /** - * Gets the value(s) for system (Sequencing System). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * System of machine used for sequencing - *

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

- * Definition: - * System of machine used for sequencing - *

- */ - public SequencingLab setSystem(System theValue) { - mySystem = theValue; - return this; - } - - - /** - * Gets the value(s) for specimen (Specimen of the lab). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Specimen of the lab - *

- */ - public Specimen getSpecimen() { - if (mySpecimen == null) { - mySpecimen = new Specimen(); - } - return mySpecimen; - } - - /** - * Sets the value(s) for specimen (Specimen of the lab) - * - *

- * Definition: - * Specimen of the lab - *

- */ - public SequencingLab setSpecimen(Specimen theValue) { - mySpecimen = theValue; - return this; - } - - - /** - * Gets the value(s) for file (File). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Files uploaded as results of the lab - *

- */ - public java.util.List getFile() { - if (myFile == null) { - myFile = new java.util.ArrayList(); - } - return myFile; - } - - /** - * Sets the value(s) for file (File) - * - *

- * Definition: - * Files uploaded as results of the lab - *

- */ - public SequencingLab setFile(java.util.List theValue) { - myFile = theValue; - return this; - } - - /** - * Adds and returns a new value for file (File) - * - *

- * Definition: - * Files uploaded as results of the lab - *

- */ - public AttachmentDt addFile() { - AttachmentDt newType = new AttachmentDt(); - getFile().add(newType); - return newType; - } - - /** - * Gets the first repetition for file (File), - * creating it if it does not already exist. - * - *

- * Definition: - * Files uploaded as results of the lab - *

- */ - public AttachmentDt getFileFirstRep() { - if (getFile().isEmpty()) { - return addFile(); - } - return getFile().get(0); - } - - /** - * Block class for child element: SequencingLab.system (Sequencing System) - * - *

- * Definition: - * System of machine used for sequencing - *

- */ - @Block() - public static class System extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="class", type=CodeDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Class of sequencing system", - formalDefinition="Class of sequencing system" - ) - private CodeDt myClassElement; - - @Child(name="version", type=StringDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Version of sequencing system", - formalDefinition="Version of sequencing system" - ) - private StringDt myVersion; - - @Child(name="name", type=CodeDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Name of sequencing system", - formalDefinition="Name of sequencing system" - ) - private CodeDt myName; - - @Child(name="identity", type=StringDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Id of sequencing system", - formalDefinition="Id of sequencing system" - ) - private StringDt myIdentity; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myClassElement, myVersion, myName, myIdentity); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myClassElement, myVersion, myName, myIdentity); - } - - /** - * Gets the value(s) for class (Class of sequencing system). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Class of sequencing system - *

- */ - public CodeDt getClassElement() { - if (myClassElement == null) { - myClassElement = new CodeDt(); - } - return myClassElement; - } - - /** - * Sets the value(s) for class (Class of sequencing system) - * - *

- * Definition: - * Class of sequencing system - *

- */ - public System setClassElement(CodeDt theValue) { - myClassElement = theValue; - return this; - } - - /** - * Sets the value for class (Class of sequencing system) - * - *

- * Definition: - * Class of sequencing system - *

- */ - public System setClassElement( String theCode) { - myClassElement = new CodeDt(theCode); - return this; - } - - - /** - * Gets the value(s) for version (Version of sequencing system). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Version of sequencing system - *

- */ - public StringDt getVersion() { - if (myVersion == null) { - myVersion = new StringDt(); - } - return myVersion; - } - - /** - * Sets the value(s) for version (Version of sequencing system) - * - *

- * Definition: - * Version of sequencing system - *

- */ - public System setVersion(StringDt theValue) { - myVersion = theValue; - return this; - } - - /** - * Sets the value for version (Version of sequencing system) - * - *

- * Definition: - * Version of sequencing system - *

- */ - public System setVersion( String theString) { - myVersion = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for name (Name of sequencing system). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Name of sequencing system - *

- */ - public CodeDt getName() { - if (myName == null) { - myName = new CodeDt(); - } - return myName; - } - - /** - * Sets the value(s) for name (Name of sequencing system) - * - *

- * Definition: - * Name of sequencing system - *

- */ - public System setName(CodeDt theValue) { - myName = theValue; - return this; - } - - /** - * Sets the value for name (Name of sequencing system) - * - *

- * Definition: - * Name of sequencing system - *

- */ - public System setName( String theCode) { - myName = new CodeDt(theCode); - return this; - } - - - /** - * Gets the value(s) for identity (Id of sequencing system). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Id of sequencing system - *

- */ - public StringDt getIdentity() { - if (myIdentity == null) { - myIdentity = new StringDt(); - } - return myIdentity; - } - - /** - * Sets the value(s) for identity (Id of sequencing system) - * - *

- * Definition: - * Id of sequencing system - *

- */ - public System setIdentity(StringDt theValue) { - myIdentity = theValue; - return this; - } - - /** - * Sets the value for identity (Id of sequencing system) - * - *

- * Definition: - * Id of sequencing system - *

- */ - public System setIdentity( String theString) { - myIdentity = new StringDt(theString); - return this; - } - - - - } - - - /** - * Block class for child element: SequencingLab.specimen (Specimen of the lab) - * - *

- * Definition: - * Specimen of the lab - *

- */ - @Block() - public static class Specimen extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="type", type=CodeDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="Class of the specimen", - formalDefinition="Whether the specimen is from germline or somatic cells of the patient" - ) - private CodeDt myType; - - @Child(name="source", type=CodeableConceptDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Source of specimen", - formalDefinition="Source of the specimen" - ) - private CodeableConceptDt mySource; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myType, mySource); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myType, mySource); - } - - /** - * Gets the value(s) for type (Class of the specimen). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Whether the specimen is from germline or somatic cells of the patient - *

- */ - public CodeDt getType() { - if (myType == null) { - myType = new CodeDt(); - } - return myType; - } - - /** - * Sets the value(s) for type (Class of the specimen) - * - *

- * Definition: - * Whether the specimen is from germline or somatic cells of the patient - *

- */ - public Specimen setType(CodeDt theValue) { - myType = theValue; - return this; - } - - /** - * Sets the value for type (Class of the specimen) - * - *

- * Definition: - * Whether the specimen is from germline or somatic cells of the patient - *

- */ - public Specimen setType( String theCode) { - myType = new CodeDt(theCode); - return this; - } - - - /** - * Gets the value(s) for source (Source of specimen). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Source of the specimen - *

- */ - public CodeableConceptDt getSource() { - if (mySource == null) { - mySource = new CodeableConceptDt(); - } - return mySource; - } - - /** - * Sets the value(s) for source (Source of specimen) - * - *

- * Definition: - * Source of the specimen - *

- */ - public Specimen setSource(CodeableConceptDt theValue) { - mySource = theValue; - return this; - } - - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Slot.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Slot.java deleted file mode 100644 index d8b738c24a3..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Slot.java +++ /dev/null @@ -1,705 +0,0 @@ - - - - - - - - - - - - - - - - -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.BaseResource; -import ca.uhn.fhir.model.api.IElement; -import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.api.Include; -import ca.uhn.fhir.model.api.TemporalPrecisionEnum; -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.Description; -import ca.uhn.fhir.model.api.annotation.ResourceDef; -import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; -import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -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.rest.gclient.DateClientParam; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR Slot Resource - * ((informative) A slot of time that may be available for booking appointments) - * - *

- * Definition: - * - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Slot - *

- * - */ -@ResourceDef(name="Slot", profile="http://hl7.org/fhir/profiles/Slot", id="slot") -public class Slot extends BaseResource implements IResource { - - /** - * Search parameter constant for slottype - *

- * Description: The type of appointments that can be booked into the slot
- * Type: token
- * Path: Slot.type
- *

- */ - @SearchParamDefinition(name="slottype", path="Slot.type", description="The type of appointments that can be booked into the slot", type="token" ) - public static final String SP_SLOTTYPE = "slottype"; - - /** - * Fluent Client search parameter constant for slottype - *

- * Description: The type of appointments that can be booked into the slot
- * Type: token
- * Path: Slot.type
- *

- */ - public static final TokenClientParam SLOTTYPE = new TokenClientParam(SP_SLOTTYPE); - - /** - * Search parameter constant for availability - *

- * Description: The Availability Resource that we are seeking a slot within
- * Type: reference
- * Path: Slot.availability
- *

- */ - @SearchParamDefinition(name="availability", path="Slot.availability", description="The Availability Resource that we are seeking a slot within", type="reference" ) - public static final String SP_AVAILABILITY = "availability"; - - /** - * Fluent Client search parameter constant for availability - *

- * Description: The Availability Resource that we are seeking a slot within
- * Type: reference
- * Path: Slot.availability
- *

- */ - public static final ReferenceClientParam AVAILABILITY = new ReferenceClientParam(SP_AVAILABILITY); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Slot.availability". - */ - public static final Include INCLUDE_AVAILABILITY = new Include("Slot.availability"); - - /** - * Search parameter constant for start - *

- * Description: Appointment date/time.
- * Type: date
- * Path: Slot.start
- *

- */ - @SearchParamDefinition(name="start", path="Slot.start", description="Appointment date/time.", type="date" ) - public static final String SP_START = "start"; - - /** - * Fluent Client search parameter constant for start - *

- * Description: Appointment date/time.
- * Type: date
- * Path: Slot.start
- *

- */ - public static final DateClientParam START = new DateClientParam(SP_START); - - /** - * Search parameter constant for fbtype - *

- * Description: The free/busy status of the appointment
- * Type: token
- * Path: Slot.freeBusyType
- *

- */ - @SearchParamDefinition(name="fbtype", path="Slot.freeBusyType", description="The free/busy status of the appointment", type="token" ) - public static final String SP_FBTYPE = "fbtype"; - - /** - * Fluent Client search parameter constant for fbtype - *

- * Description: The free/busy status of the appointment
- * Type: token
- * Path: Slot.freeBusyType
- *

- */ - public static final TokenClientParam FBTYPE = new TokenClientParam(SP_FBTYPE); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="External Ids for this item", - formalDefinition="" - ) - private java.util.List myIdentifier; - - @Child(name="type", type=CodeableConceptDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource", - formalDefinition="" - ) - private CodeableConceptDt myType; - - @Child(name="availability", order=2, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Availability.class }) - @Description( - shortDefinition="The availability resource that this slot defines an interval of status information", - formalDefinition="" - ) - private ResourceReferenceDt myAvailability; - - @Child(name="freeBusyType", type=CodeDt.class, order=3, min=1, max=1) - @Description( - shortDefinition="BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE", - formalDefinition="" - ) - private CodeDt myFreeBusyType; - - @Child(name="start", type=InstantDt.class, order=4, min=1, max=1) - @Description( - shortDefinition="Date/Time that the slot is to begin", - formalDefinition="" - ) - private InstantDt myStart; - - @Child(name="end", type=InstantDt.class, order=5, min=1, max=1) - @Description( - shortDefinition="Date/Time that the slot is to conclude", - formalDefinition="" - ) - private InstantDt myEnd; - - @Child(name="comment", type=StringDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="Comments on the slot to describe any extended information. Such as custom constraints on the slot", - formalDefinition="" - ) - private StringDt myComment; - - @Child(name="author", order=7, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class, ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.RelatedPerson.class }) - @Description( - shortDefinition="Who authored the slot", - formalDefinition="" - ) - private ResourceReferenceDt myAuthor; - - @Child(name="authorDate", type=DateTimeDt.class, order=8, min=0, max=1) - @Description( - shortDefinition="When this slot was created, or last revised", - formalDefinition="" - ) - private DateTimeDt myAuthorDate; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myType, myAvailability, myFreeBusyType, myStart, myEnd, myComment, myAuthor, myAuthorDate); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myType, myAvailability, myFreeBusyType, myStart, myEnd, myComment, myAuthor, myAuthorDate); - } - - /** - * Gets the value(s) for identifier (External Ids for this item). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (External Ids for this item) - * - *

- * Definition: - * - *

- */ - public Slot setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (External Ids for this item) - * - *

- * Definition: - * - *

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (External Ids for this item), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (External Ids for this item) - * - *

- * Definition: - * - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Slot addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (External Ids for this item) - * - *

- * Definition: - * - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Slot addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for type (The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public CodeableConceptDt getType() { - if (myType == null) { - myType = new CodeableConceptDt(); - } - return myType; - } - - /** - * Sets the value(s) for type (The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource) - * - *

- * Definition: - * - *

- */ - public Slot setType(CodeableConceptDt theValue) { - myType = theValue; - return this; - } - - - /** - * Gets the value(s) for availability (The availability resource that this slot defines an interval of status information). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt getAvailability() { - if (myAvailability == null) { - myAvailability = new ResourceReferenceDt(); - } - return myAvailability; - } - - /** - * Sets the value(s) for availability (The availability resource that this slot defines an interval of status information) - * - *

- * Definition: - * - *

- */ - public Slot setAvailability(ResourceReferenceDt theValue) { - myAvailability = theValue; - return this; - } - - - /** - * Gets the value(s) for freeBusyType (BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public CodeDt getFreeBusyType() { - if (myFreeBusyType == null) { - myFreeBusyType = new CodeDt(); - } - return myFreeBusyType; - } - - /** - * Sets the value(s) for freeBusyType (BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE) - * - *

- * Definition: - * - *

- */ - public Slot setFreeBusyType(CodeDt theValue) { - myFreeBusyType = theValue; - return this; - } - - /** - * Sets the value for freeBusyType (BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE) - * - *

- * Definition: - * - *

- */ - public Slot setFreeBusyType( String theCode) { - myFreeBusyType = new CodeDt(theCode); - return this; - } - - - /** - * Gets the value(s) for start (Date/Time that the slot is to begin). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public InstantDt getStart() { - if (myStart == null) { - myStart = new InstantDt(); - } - return myStart; - } - - /** - * Sets the value(s) for start (Date/Time that the slot is to begin) - * - *

- * Definition: - * - *

- */ - public Slot setStart(InstantDt theValue) { - myStart = theValue; - return this; - } - - /** - * Sets the value for start (Date/Time that the slot is to begin) - * - *

- * Definition: - * - *

- */ - public Slot setStart( Date theDate, TemporalPrecisionEnum thePrecision) { - myStart = new InstantDt(theDate, thePrecision); - return this; - } - - /** - * Sets the value for start (Date/Time that the slot is to begin) - * - *

- * Definition: - * - *

- */ - public Slot setStartWithMillisPrecision( Date theDate) { - myStart = new InstantDt(theDate); - return this; - } - - - /** - * Gets the value(s) for end (Date/Time that the slot is to conclude). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public InstantDt getEnd() { - if (myEnd == null) { - myEnd = new InstantDt(); - } - return myEnd; - } - - /** - * Sets the value(s) for end (Date/Time that the slot is to conclude) - * - *

- * Definition: - * - *

- */ - public Slot setEnd(InstantDt theValue) { - myEnd = theValue; - return this; - } - - /** - * Sets the value for end (Date/Time that the slot is to conclude) - * - *

- * Definition: - * - *

- */ - public Slot setEnd( Date theDate, TemporalPrecisionEnum thePrecision) { - myEnd = new InstantDt(theDate, thePrecision); - return this; - } - - /** - * Sets the value for end (Date/Time that the slot is to conclude) - * - *

- * Definition: - * - *

- */ - public Slot setEndWithMillisPrecision( Date theDate) { - myEnd = new InstantDt(theDate); - return this; - } - - - /** - * Gets the value(s) for comment (Comments on the slot to describe any extended information. Such as custom constraints on the slot). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public StringDt getComment() { - if (myComment == null) { - myComment = new StringDt(); - } - return myComment; - } - - /** - * Sets the value(s) for comment (Comments on the slot to describe any extended information. Such as custom constraints on the slot) - * - *

- * Definition: - * - *

- */ - public Slot setComment(StringDt theValue) { - myComment = theValue; - return this; - } - - /** - * Sets the value for comment (Comments on the slot to describe any extended information. Such as custom constraints on the slot) - * - *

- * Definition: - * - *

- */ - public Slot setComment( String theString) { - myComment = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for author (Who authored the slot). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt getAuthor() { - if (myAuthor == null) { - myAuthor = new ResourceReferenceDt(); - } - return myAuthor; - } - - /** - * Sets the value(s) for author (Who authored the slot) - * - *

- * Definition: - * - *

- */ - public Slot setAuthor(ResourceReferenceDt theValue) { - myAuthor = theValue; - return this; - } - - - /** - * Gets the value(s) for authorDate (When this slot was created, or last revised). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public DateTimeDt getAuthorDate() { - if (myAuthorDate == null) { - myAuthorDate = new DateTimeDt(); - } - return myAuthorDate; - } - - /** - * Sets the value(s) for authorDate (When this slot was created, or last revised) - * - *

- * Definition: - * - *

- */ - public Slot setAuthorDate(DateTimeDt theValue) { - myAuthorDate = theValue; - return this; - } - - /** - * Sets the value for authorDate (When this slot was created, or last revised) - * - *

- * Definition: - * - *

- */ - public Slot setAuthorDateWithSecondsPrecision( Date theDate) { - myAuthorDate = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for authorDate (When this slot was created, or last revised) - * - *

- * Definition: - * - *

- */ - public Slot setAuthorDate( Date theDate, TemporalPrecisionEnum thePrecision) { - myAuthorDate = new DateTimeDt(theDate, thePrecision); - return this; - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Specimen.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Specimen.java deleted file mode 100644 index dce33742a7f..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Specimen.java +++ /dev/null @@ -1,1874 +0,0 @@ - - - - - - - - - - - - - - - - -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.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.HierarchicalRelationshipTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; -import ca.uhn.fhir.model.dstu.valueset.SpecimenCollectionMethodEnum; -import ca.uhn.fhir.model.dstu.valueset.SpecimenTreatmentProcedureEnum; -import ca.uhn.fhir.model.primitive.BoundCodeDt; -import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; -import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; - - -/** - * HAPI/FHIR Specimen Resource - * (Sample for analysis) - * - *

- * Definition: - * Sample for analysis - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Specimen - *

- * - */ -@ResourceDef(name="Specimen", profile="http://hl7.org/fhir/profiles/Specimen", id="specimen") -public class Specimen extends BaseResource implements IResource { - - /** - * Search parameter constant for subject - *

- * Description: The subject of the specimen
- * Type: reference
- * Path: Specimen.subject
- *

- */ - @SearchParamDefinition(name="subject", path="Specimen.subject", description="The subject of the specimen", type="reference" ) - public static final String SP_SUBJECT = "subject"; - - /** - * Fluent Client search parameter constant for subject - *

- * Description: The subject of the specimen
- * Type: reference
- * Path: Specimen.subject
- *

- */ - public static final ReferenceClientParam SUBJECT = new ReferenceClientParam(SP_SUBJECT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Specimen.subject". - */ - public static final Include INCLUDE_SUBJECT = new Include("Specimen.subject"); - - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="External Identifier", - formalDefinition="Id for specimen" - ) - private java.util.List myIdentifier; - - @Child(name="type", type=CodeableConceptDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Kind of material that forms the specimen", - formalDefinition="Kind of material that forms the specimen" - ) - private CodeableConceptDt myType; - - @Child(name="source", order=2, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Parent of specimen", - formalDefinition="Parent specimen from which the focal specimen was a component" - ) - private java.util.List mySource; - - @Child(name="subject", order=3, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class, ca.uhn.fhir.model.dstu.resource.Group.class, ca.uhn.fhir.model.dstu.resource.Device.class, ca.uhn.fhir.model.dstu.resource.Substance.class }) - @Description( - shortDefinition="Where the specimen came from. This may be the patient(s) or from the environment or a device", - formalDefinition="" - ) - private ResourceReferenceDt mySubject; - - @Child(name="accessionIdentifier", type=IdentifierDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="Identifier assigned by the lab", - formalDefinition="The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures." - ) - private IdentifierDt myAccessionIdentifier; - - @Child(name="receivedTime", type=DateTimeDt.class, order=5, min=0, max=1) - @Description( - shortDefinition="The time when specimen was received for processing", - formalDefinition="Time when specimen was received for processing or testing" - ) - private DateTimeDt myReceivedTime; - - @Child(name="collection", order=6, min=1, max=1) - @Description( - shortDefinition="Collection details", - formalDefinition="Details concerning the specimen collection" - ) - private Collection myCollection; - - @Child(name="treatment", order=7, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Treatment and processing step details", - formalDefinition="Details concerning treatment and processing steps for the specimen" - ) - private java.util.List myTreatment; - - @Child(name="container", order=8, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Direct container of specimen (tube/slide, etc)", - formalDefinition="The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here." - ) - private java.util.List myContainer; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myType, mySource, mySubject, myAccessionIdentifier, myReceivedTime, myCollection, myTreatment, myContainer); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myType, mySource, mySubject, myAccessionIdentifier, myReceivedTime, myCollection, myTreatment, myContainer); - } - - /** - * Gets the value(s) for identifier (External Identifier). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Id for specimen - *

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (External Identifier) - * - *

- * Definition: - * Id for specimen - *

- */ - public Specimen setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (External Identifier) - * - *

- * Definition: - * Id for specimen - *

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (External Identifier), - * creating it if it does not already exist. - * - *

- * Definition: - * Id for specimen - *

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (External Identifier) - * - *

- * Definition: - * Id for specimen - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Specimen addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (External Identifier) - * - *

- * Definition: - * Id for specimen - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Specimen addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for type (Kind of material that forms the specimen). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Kind of material that forms the specimen - *

- */ - public CodeableConceptDt getType() { - if (myType == null) { - myType = new CodeableConceptDt(); - } - return myType; - } - - /** - * Sets the value(s) for type (Kind of material that forms the specimen) - * - *

- * Definition: - * Kind of material that forms the specimen - *

- */ - public Specimen setType(CodeableConceptDt theValue) { - myType = theValue; - return this; - } - - - /** - * Gets the value(s) for source (Parent of specimen). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getSource() { - if (mySource == null) { - mySource = new java.util.ArrayList(); - } - return mySource; - } - - /** - * Sets the value(s) for source (Parent of specimen) - * - *

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

- */ - public Specimen setSource(java.util.List theValue) { - mySource = theValue; - return this; - } - - /** - * Adds and returns a new value for source (Parent of specimen) - * - *

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

- */ - public Source addSource() { - Source newType = new Source(); - getSource().add(newType); - return newType; - } - - /** - * Gets the first repetition for source (Parent of specimen), - * creating it if it does not already exist. - * - *

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

- */ - public Source getSourceFirstRep() { - if (getSource().isEmpty()) { - return addSource(); - } - return getSource().get(0); - } - - /** - * Gets the value(s) for subject (Where the specimen came from. This may be the patient(s) or from the environment or a device). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt getSubject() { - if (mySubject == null) { - mySubject = new ResourceReferenceDt(); - } - return mySubject; - } - - /** - * Sets the value(s) for subject (Where the specimen came from. This may be the patient(s) or from the environment or a device) - * - *

- * Definition: - * - *

- */ - public Specimen setSubject(ResourceReferenceDt theValue) { - mySubject = theValue; - return this; - } - - - /** - * Gets the value(s) for accessionIdentifier (Identifier assigned by the lab). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures. - *

- */ - public IdentifierDt getAccessionIdentifier() { - if (myAccessionIdentifier == null) { - myAccessionIdentifier = new IdentifierDt(); - } - return myAccessionIdentifier; - } - - /** - * Sets the value(s) for accessionIdentifier (Identifier assigned by the lab) - * - *

- * Definition: - * The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures. - *

- */ - public Specimen setAccessionIdentifier(IdentifierDt theValue) { - myAccessionIdentifier = theValue; - return this; - } - - /** - * Sets the value for accessionIdentifier (Identifier assigned by the lab) - * - *

- * Definition: - * The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures. - *

- */ - public Specimen setAccessionIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - myAccessionIdentifier = new IdentifierDt(theUse, theSystem, theValue, theLabel); - return this; - } - - /** - * Sets the value for accessionIdentifier (Identifier assigned by the lab) - * - *

- * Definition: - * The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures. - *

- */ - public Specimen setAccessionIdentifier( String theSystem, String theValue) { - myAccessionIdentifier = new IdentifierDt(theSystem, theValue); - return this; - } - - - /** - * Gets the value(s) for receivedTime (The time when specimen was received for processing). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Time when specimen was received for processing or testing - *

- */ - public DateTimeDt getReceivedTime() { - if (myReceivedTime == null) { - myReceivedTime = new DateTimeDt(); - } - return myReceivedTime; - } - - /** - * Sets the value(s) for receivedTime (The time when specimen was received for processing) - * - *

- * Definition: - * Time when specimen was received for processing or testing - *

- */ - public Specimen setReceivedTime(DateTimeDt theValue) { - myReceivedTime = theValue; - return this; - } - - /** - * Sets the value for receivedTime (The time when specimen was received for processing) - * - *

- * Definition: - * Time when specimen was received for processing or testing - *

- */ - public Specimen setReceivedTimeWithSecondsPrecision( Date theDate) { - myReceivedTime = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for receivedTime (The time when specimen was received for processing) - * - *

- * Definition: - * Time when specimen was received for processing or testing - *

- */ - public Specimen setReceivedTime( Date theDate, TemporalPrecisionEnum thePrecision) { - myReceivedTime = new DateTimeDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for collection (Collection details). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Details concerning the specimen collection - *

- */ - public Collection getCollection() { - if (myCollection == null) { - myCollection = new Collection(); - } - return myCollection; - } - - /** - * Sets the value(s) for collection (Collection details) - * - *

- * Definition: - * Details concerning the specimen collection - *

- */ - public Specimen setCollection(Collection theValue) { - myCollection = theValue; - return this; - } - - - /** - * Gets the value(s) for treatment (Treatment and processing step details). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getTreatment() { - if (myTreatment == null) { - myTreatment = new java.util.ArrayList(); - } - return myTreatment; - } - - /** - * Sets the value(s) for treatment (Treatment and processing step details) - * - *

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

- */ - public Specimen setTreatment(java.util.List theValue) { - myTreatment = theValue; - return this; - } - - /** - * Adds and returns a new value for treatment (Treatment and processing step details) - * - *

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

- */ - public Treatment addTreatment() { - Treatment newType = new Treatment(); - getTreatment().add(newType); - return newType; - } - - /** - * Gets the first repetition for treatment (Treatment and processing step details), - * creating it if it does not already exist. - * - *

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

- */ - public Treatment getTreatmentFirstRep() { - if (getTreatment().isEmpty()) { - return addTreatment(); - } - return getTreatment().get(0); - } - - /** - * Gets the value(s) for container (Direct container of specimen (tube/slide, etc)). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getContainer() { - if (myContainer == null) { - myContainer = new java.util.ArrayList(); - } - return myContainer; - } - - /** - * Sets the value(s) for container (Direct container of specimen (tube/slide, etc)) - * - *

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

- */ - public Specimen setContainer(java.util.List theValue) { - myContainer = theValue; - return this; - } - - /** - * Adds and returns a new value for container (Direct container of specimen (tube/slide, etc)) - * - *

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

- */ - public Container addContainer() { - Container newType = new Container(); - getContainer().add(newType); - return newType; - } - - /** - * Gets the first repetition for container (Direct container of specimen (tube/slide, etc)), - * creating it if it does not already exist. - * - *

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

- */ - public Container getContainerFirstRep() { - if (getContainer().isEmpty()) { - return addContainer(); - } - return getContainer().get(0); - } - - /** - * Block class for child element: Specimen.source (Parent of specimen) - * - *

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

- */ - @Block() - public static class Source extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="relationship", type=CodeDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="parent | child", - formalDefinition="Whether this relationship is to a parent or to a child" - ) - private BoundCodeDt myRelationship; - - @Child(name="target", order=1, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Specimen.class }) - @Description( - shortDefinition="The subject of the relationship", - formalDefinition="The specimen resource that is the target of this relationship" - ) - private java.util.List myTarget; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myRelationship, myTarget); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myRelationship, myTarget); - } - - /** - * Gets the value(s) for relationship (parent | child). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Whether this relationship is to a parent or to a child - *

- */ - public BoundCodeDt getRelationship() { - if (myRelationship == null) { - myRelationship = new BoundCodeDt(HierarchicalRelationshipTypeEnum.VALUESET_BINDER); - } - return myRelationship; - } - - /** - * Sets the value(s) for relationship (parent | child) - * - *

- * Definition: - * Whether this relationship is to a parent or to a child - *

- */ - public Source setRelationship(BoundCodeDt theValue) { - myRelationship = theValue; - return this; - } - - /** - * Sets the value(s) for relationship (parent | child) - * - *

- * Definition: - * Whether this relationship is to a parent or to a child - *

- */ - public Source setRelationship(HierarchicalRelationshipTypeEnum theValue) { - getRelationship().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for target (The subject of the relationship). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getTarget() { - if (myTarget == null) { - myTarget = new java.util.ArrayList(); - } - return myTarget; - } - - /** - * Sets the value(s) for target (The subject of the relationship) - * - *

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

- */ - public Source setTarget(java.util.List theValue) { - myTarget = theValue; - return this; - } - - /** - * Adds and returns a new value for target (The subject of the relationship) - * - *

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

- */ - public ResourceReferenceDt addTarget() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getTarget().add(newType); - return newType; - } - - - } - - - /** - * Block class for child element: Specimen.collection (Collection details) - * - *

- * Definition: - * Details concerning the specimen collection - *

- */ - @Block() - public static class Collection extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="collector", order=0, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class }) - @Description( - shortDefinition="Who collected the specimen", - formalDefinition="Person who collected the specimen" - ) - private ResourceReferenceDt myCollector; - - @Child(name="comment", type=StringDt.class, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Collector comments", - formalDefinition="To communicate any details or issues encountered during the specimen collection procedure." - ) - private java.util.List myComment; - - @Child(name="collected", order=2, min=0, max=1, type={ - DateTimeDt.class, PeriodDt.class }) - @Description( - shortDefinition="Collection time", - formalDefinition="Time when specimen was collected from subject - the physiologically relevant time" - ) - private IDatatype myCollected; - - @Child(name="quantity", type=QuantityDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="The quantity of specimen collected", - formalDefinition="The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample" - ) - private QuantityDt myQuantity; - - @Child(name="method", type=CodeableConceptDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="Technique used to perform collection", - formalDefinition="A coded value specifying the technique that is used to perform the procedure" - ) - private BoundCodeableConceptDt myMethod; - - @Child(name="sourceSite", type=CodeableConceptDt.class, order=5, min=0, max=1) - @Description( - shortDefinition="Anatomical collection site", - formalDefinition="Anatomical location from which the specimen should be collected (if subject is a patient). This element is not used for environmental specimens." - ) - private CodeableConceptDt mySourceSite; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCollector, myComment, myCollected, myQuantity, myMethod, mySourceSite); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCollector, myComment, myCollected, myQuantity, myMethod, mySourceSite); - } - - /** - * Gets the value(s) for collector (Who collected the specimen). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Person who collected the specimen - *

- */ - public ResourceReferenceDt getCollector() { - if (myCollector == null) { - myCollector = new ResourceReferenceDt(); - } - return myCollector; - } - - /** - * Sets the value(s) for collector (Who collected the specimen) - * - *

- * Definition: - * Person who collected the specimen - *

- */ - public Collection setCollector(ResourceReferenceDt theValue) { - myCollector = theValue; - return this; - } - - - /** - * Gets the value(s) for comment (Collector comments). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getComment() { - if (myComment == null) { - myComment = new java.util.ArrayList(); - } - return myComment; - } - - /** - * Sets the value(s) for comment (Collector comments) - * - *

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

- */ - public Collection setComment(java.util.List theValue) { - myComment = theValue; - return this; - } - - /** - * Adds and returns a new value for comment (Collector comments) - * - *

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

- */ - public StringDt addComment() { - StringDt newType = new StringDt(); - getComment().add(newType); - return newType; - } - - /** - * Gets the first repetition for comment (Collector comments), - * creating it if it does not already exist. - * - *

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

- */ - public StringDt getCommentFirstRep() { - if (getComment().isEmpty()) { - return addComment(); - } - return getComment().get(0); - } - /** - * Adds a new value for comment (Collector comments) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Collection addComment( String theString) { - if (myComment == null) { - myComment = new java.util.ArrayList(); - } - myComment.add(new StringDt(theString)); - return this; - } - - - /** - * Gets the value(s) for collected[x] (Collection time). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Time when specimen was collected from subject - the physiologically relevant time - *

- */ - public IDatatype getCollected() { - return myCollected; - } - - /** - * Sets the value(s) for collected[x] (Collection time) - * - *

- * Definition: - * Time when specimen was collected from subject - the physiologically relevant time - *

- */ - public Collection setCollected(IDatatype theValue) { - myCollected = theValue; - return this; - } - - - /** - * Gets the value(s) for quantity (The quantity of specimen collected). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample - *

- */ - public QuantityDt getQuantity() { - if (myQuantity == null) { - myQuantity = new QuantityDt(); - } - return myQuantity; - } - - /** - * Sets the value(s) for quantity (The quantity of specimen collected) - * - *

- * Definition: - * The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample - *

- */ - public Collection setQuantity(QuantityDt theValue) { - myQuantity = theValue; - return this; - } - - /** - * Sets the value for quantity (The quantity of specimen collected) - * - *

- * Definition: - * The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample - *

- */ - public Collection setQuantity( QuantityCompararatorEnum theComparator, double theValue, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for quantity (The quantity of specimen collected) - * - *

- * Definition: - * The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample - *

- */ - public Collection setQuantity( QuantityCompararatorEnum theComparator, long theValue, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for quantity (The quantity of specimen collected) - * - *

- * Definition: - * The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample - *

- */ - public Collection setQuantity( QuantityCompararatorEnum theComparator, double theValue, String theSystem, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for quantity (The quantity of specimen collected) - * - *

- * Definition: - * The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample - *

- */ - public Collection setQuantity( QuantityCompararatorEnum theComparator, long theValue, String theSystem, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for quantity (The quantity of specimen collected) - * - *

- * Definition: - * The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample - *

- */ - public Collection setQuantity( double theValue) { - myQuantity = new QuantityDt(theValue); - return this; - } - - /** - * Sets the value for quantity (The quantity of specimen collected) - * - *

- * Definition: - * The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample - *

- */ - public Collection setQuantity( long theValue) { - myQuantity = new QuantityDt(theValue); - return this; - } - - - /** - * Gets the value(s) for method (Technique used to perform collection). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A coded value specifying the technique that is used to perform the procedure - *

- */ - public BoundCodeableConceptDt getMethod() { - if (myMethod == null) { - myMethod = new BoundCodeableConceptDt(SpecimenCollectionMethodEnum.VALUESET_BINDER); - } - return myMethod; - } - - /** - * Sets the value(s) for method (Technique used to perform collection) - * - *

- * Definition: - * A coded value specifying the technique that is used to perform the procedure - *

- */ - public Collection setMethod(BoundCodeableConceptDt theValue) { - myMethod = theValue; - return this; - } - - /** - * Sets the value(s) for method (Technique used to perform collection) - * - *

- * Definition: - * A coded value specifying the technique that is used to perform the procedure - *

- */ - public Collection setMethod(SpecimenCollectionMethodEnum theValue) { - getMethod().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for sourceSite (Anatomical collection site). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Anatomical location from which the specimen should be collected (if subject is a patient). This element is not used for environmental specimens. - *

- */ - public CodeableConceptDt getSourceSite() { - if (mySourceSite == null) { - mySourceSite = new CodeableConceptDt(); - } - return mySourceSite; - } - - /** - * Sets the value(s) for sourceSite (Anatomical collection site) - * - *

- * Definition: - * Anatomical location from which the specimen should be collected (if subject is a patient). This element is not used for environmental specimens. - *

- */ - public Collection setSourceSite(CodeableConceptDt theValue) { - mySourceSite = theValue; - return this; - } - - - - } - - - /** - * Block class for child element: Specimen.treatment (Treatment and processing step details) - * - *

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

- */ - @Block() - public static class Treatment extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="description", type=StringDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Textual description of procedure", - formalDefinition="" - ) - private StringDt myDescription; - - @Child(name="procedure", type=CodeableConceptDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Indicates the treatment or processing step applied to the specimen", - formalDefinition="A coded value specifying the procedure used to process the specimen" - ) - private BoundCodeableConceptDt myProcedure; - - @Child(name="additive", order=2, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Substance.class }) - @Description( - shortDefinition="Material used in the processing step", - formalDefinition="" - ) - private java.util.List myAdditive; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myDescription, myProcedure, myAdditive); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myDescription, myProcedure, myAdditive); - } - - /** - * Gets the value(s) for description (Textual description of procedure). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public StringDt getDescription() { - if (myDescription == null) { - myDescription = new StringDt(); - } - return myDescription; - } - - /** - * Sets the value(s) for description (Textual description of procedure) - * - *

- * Definition: - * - *

- */ - public Treatment setDescription(StringDt theValue) { - myDescription = theValue; - return this; - } - - /** - * Sets the value for description (Textual description of procedure) - * - *

- * Definition: - * - *

- */ - public Treatment setDescription( String theString) { - myDescription = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for procedure (Indicates the treatment or processing step applied to the specimen). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A coded value specifying the procedure used to process the specimen - *

- */ - public BoundCodeableConceptDt getProcedure() { - if (myProcedure == null) { - myProcedure = new BoundCodeableConceptDt(SpecimenTreatmentProcedureEnum.VALUESET_BINDER); - } - return myProcedure; - } - - /** - * Sets the value(s) for procedure (Indicates the treatment or processing step applied to the specimen) - * - *

- * Definition: - * A coded value specifying the procedure used to process the specimen - *

- */ - public Treatment setProcedure(BoundCodeableConceptDt theValue) { - myProcedure = theValue; - return this; - } - - /** - * Sets the value(s) for procedure (Indicates the treatment or processing step applied to the specimen) - * - *

- * Definition: - * A coded value specifying the procedure used to process the specimen - *

- */ - public Treatment setProcedure(SpecimenTreatmentProcedureEnum theValue) { - getProcedure().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for additive (Material used in the processing step). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getAdditive() { - if (myAdditive == null) { - myAdditive = new java.util.ArrayList(); - } - return myAdditive; - } - - /** - * Sets the value(s) for additive (Material used in the processing step) - * - *

- * Definition: - * - *

- */ - public Treatment setAdditive(java.util.List theValue) { - myAdditive = theValue; - return this; - } - - /** - * Adds and returns a new value for additive (Material used in the processing step) - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt addAdditive() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getAdditive().add(newType); - return newType; - } - - - } - - - /** - * Block class for child element: Specimen.container (Direct container of specimen (tube/slide, etc)) - * - *

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

- */ - @Block() - public static class Container extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Id for the container", - formalDefinition="Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances" - ) - private java.util.List myIdentifier; - - @Child(name="description", type=StringDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Textual description of the container", - formalDefinition="" - ) - private StringDt myDescription; - - @Child(name="type", type=CodeableConceptDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Kind of container directly associated with specimen", - formalDefinition="The type of container associated with the specimen (e.g. slide, aliquot, etc)" - ) - private CodeableConceptDt myType; - - @Child(name="capacity", type=QuantityDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Container volume or size", - formalDefinition="The capacity (volume or other measure) the container may contain." - ) - private QuantityDt myCapacity; - - @Child(name="specimenQuantity", type=QuantityDt.class, order=4, min=0, max=1) - @Description( - shortDefinition="Quantity of specimen within container", - formalDefinition="The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type" - ) - private QuantityDt mySpecimenQuantity; - - @Child(name="additive", order=5, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Substance.class }) - @Description( - shortDefinition="Additive associated with container", - formalDefinition="Additive associated with the container" - ) - private ResourceReferenceDt myAdditive; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myDescription, myType, myCapacity, mySpecimenQuantity, myAdditive); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myDescription, myType, myCapacity, mySpecimenQuantity, myAdditive); - } - - /** - * Gets the value(s) for identifier (Id for the container). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Id for the container) - * - *

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

- */ - public Container setIdentifier(java.util.List theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Adds and returns a new value for identifier (Id for the container) - * - *

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

- */ - public IdentifierDt addIdentifier() { - IdentifierDt newType = new IdentifierDt(); - getIdentifier().add(newType); - return newType; - } - - /** - * Gets the first repetition for identifier (Id for the container), - * creating it if it does not already exist. - * - *

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

- */ - public IdentifierDt getIdentifierFirstRep() { - if (getIdentifier().isEmpty()) { - return addIdentifier(); - } - return getIdentifier().get(0); - } - /** - * Adds a new value for identifier (Id for the container) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Container addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel)); - return this; - } - - /** - * Adds a new value for identifier (Id for the container) - * - *

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

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Container addIdentifier( String theSystem, String theValue) { - if (myIdentifier == null) { - myIdentifier = new java.util.ArrayList(); - } - myIdentifier.add(new IdentifierDt(theSystem, theValue)); - return this; - } - - - /** - * Gets the value(s) for description (Textual description of the container). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public StringDt getDescription() { - if (myDescription == null) { - myDescription = new StringDt(); - } - return myDescription; - } - - /** - * Sets the value(s) for description (Textual description of the container) - * - *

- * Definition: - * - *

- */ - public Container setDescription(StringDt theValue) { - myDescription = theValue; - return this; - } - - /** - * Sets the value for description (Textual description of the container) - * - *

- * Definition: - * - *

- */ - public Container setDescription( String theString) { - myDescription = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for type (Kind of container directly associated with specimen). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The type of container associated with the specimen (e.g. slide, aliquot, etc) - *

- */ - public CodeableConceptDt getType() { - if (myType == null) { - myType = new CodeableConceptDt(); - } - return myType; - } - - /** - * Sets the value(s) for type (Kind of container directly associated with specimen) - * - *

- * Definition: - * The type of container associated with the specimen (e.g. slide, aliquot, etc) - *

- */ - public Container setType(CodeableConceptDt theValue) { - myType = theValue; - return this; - } - - - /** - * Gets the value(s) for capacity (Container volume or size). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The capacity (volume or other measure) the container may contain. - *

- */ - public QuantityDt getCapacity() { - if (myCapacity == null) { - myCapacity = new QuantityDt(); - } - return myCapacity; - } - - /** - * Sets the value(s) for capacity (Container volume or size) - * - *

- * Definition: - * The capacity (volume or other measure) the container may contain. - *

- */ - public Container setCapacity(QuantityDt theValue) { - myCapacity = theValue; - return this; - } - - /** - * Sets the value for capacity (Container volume or size) - * - *

- * Definition: - * The capacity (volume or other measure) the container may contain. - *

- */ - public Container setCapacity( QuantityCompararatorEnum theComparator, double theValue, String theUnits) { - myCapacity = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for capacity (Container volume or size) - * - *

- * Definition: - * The capacity (volume or other measure) the container may contain. - *

- */ - public Container setCapacity( QuantityCompararatorEnum theComparator, long theValue, String theUnits) { - myCapacity = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for capacity (Container volume or size) - * - *

- * Definition: - * The capacity (volume or other measure) the container may contain. - *

- */ - public Container setCapacity( QuantityCompararatorEnum theComparator, double theValue, String theSystem, String theUnits) { - myCapacity = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for capacity (Container volume or size) - * - *

- * Definition: - * The capacity (volume or other measure) the container may contain. - *

- */ - public Container setCapacity( QuantityCompararatorEnum theComparator, long theValue, String theSystem, String theUnits) { - myCapacity = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for capacity (Container volume or size) - * - *

- * Definition: - * The capacity (volume or other measure) the container may contain. - *

- */ - public Container setCapacity( double theValue) { - myCapacity = new QuantityDt(theValue); - return this; - } - - /** - * Sets the value for capacity (Container volume or size) - * - *

- * Definition: - * The capacity (volume or other measure) the container may contain. - *

- */ - public Container setCapacity( long theValue) { - myCapacity = new QuantityDt(theValue); - return this; - } - - - /** - * Gets the value(s) for specimenQuantity (Quantity of specimen within container). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type - *

- */ - public QuantityDt getSpecimenQuantity() { - if (mySpecimenQuantity == null) { - mySpecimenQuantity = new QuantityDt(); - } - return mySpecimenQuantity; - } - - /** - * Sets the value(s) for specimenQuantity (Quantity of specimen within container) - * - *

- * Definition: - * The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type - *

- */ - public Container setSpecimenQuantity(QuantityDt theValue) { - mySpecimenQuantity = theValue; - return this; - } - - /** - * Sets the value for specimenQuantity (Quantity of specimen within container) - * - *

- * Definition: - * The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type - *

- */ - public Container setSpecimenQuantity( QuantityCompararatorEnum theComparator, double theValue, String theUnits) { - mySpecimenQuantity = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for specimenQuantity (Quantity of specimen within container) - * - *

- * Definition: - * The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type - *

- */ - public Container setSpecimenQuantity( QuantityCompararatorEnum theComparator, long theValue, String theUnits) { - mySpecimenQuantity = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for specimenQuantity (Quantity of specimen within container) - * - *

- * Definition: - * The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type - *

- */ - public Container setSpecimenQuantity( QuantityCompararatorEnum theComparator, double theValue, String theSystem, String theUnits) { - mySpecimenQuantity = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for specimenQuantity (Quantity of specimen within container) - * - *

- * Definition: - * The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type - *

- */ - public Container setSpecimenQuantity( QuantityCompararatorEnum theComparator, long theValue, String theSystem, String theUnits) { - mySpecimenQuantity = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for specimenQuantity (Quantity of specimen within container) - * - *

- * Definition: - * The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type - *

- */ - public Container setSpecimenQuantity( double theValue) { - mySpecimenQuantity = new QuantityDt(theValue); - return this; - } - - /** - * Sets the value for specimenQuantity (Quantity of specimen within container) - * - *

- * Definition: - * The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type - *

- */ - public Container setSpecimenQuantity( long theValue) { - mySpecimenQuantity = new QuantityDt(theValue); - return this; - } - - - /** - * Gets the value(s) for additive (Additive associated with container). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Additive associated with the container - *

- */ - public ResourceReferenceDt getAdditive() { - if (myAdditive == null) { - myAdditive = new ResourceReferenceDt(); - } - return myAdditive; - } - - /** - * Sets the value(s) for additive (Additive associated with container) - * - *

- * Definition: - * Additive associated with the container - *

- */ - public Container setAdditive(ResourceReferenceDt theValue) { - myAdditive = theValue; - return this; - } - - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Substance.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Substance.java deleted file mode 100644 index f816152f445..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Substance.java +++ /dev/null @@ -1,800 +0,0 @@ - - - - - - - - - - - - - - - - -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.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.RatioDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; -import ca.uhn.fhir.model.dstu.valueset.SubstanceTypeEnum; -import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; -import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.rest.gclient.DateClientParam; -import ca.uhn.fhir.rest.gclient.NumberClientParam; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR Substance Resource - * (A homogeneous material with a definite composition) - * - *

- * Definition: - * - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Substance - *

- * - */ -@ResourceDef(name="Substance", profile="http://hl7.org/fhir/profiles/Substance", id="substance") -public class Substance extends BaseResource implements IResource { - - /** - * Search parameter constant for type - *

- * Description: The type of the substance
- * Type: token
- * Path: Substance.type
- *

- */ - @SearchParamDefinition(name="type", path="Substance.type", description="The type of the substance", type="token" ) - public static final String SP_TYPE = "type"; - - /** - * Fluent Client search parameter constant for type - *

- * Description: The type of the substance
- * Type: token
- * Path: Substance.type
- *

- */ - public static final TokenClientParam TYPE = new TokenClientParam(SP_TYPE); - - /** - * Search parameter constant for identifier - *

- * Description:
- * Type: token
- * Path: Substance.instance.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Substance.instance.identifier", description="", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - - /** - * Fluent Client search parameter constant for identifier - *

- * Description:
- * Type: token
- * Path: Substance.instance.identifier
- *

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

- * Description:
- * Type: date
- * Path: Substance.instance.expiry
- *

- */ - @SearchParamDefinition(name="expiry", path="Substance.instance.expiry", description="", type="date" ) - public static final String SP_EXPIRY = "expiry"; - - /** - * Fluent Client search parameter constant for expiry - *

- * Description:
- * Type: date
- * Path: Substance.instance.expiry
- *

- */ - public static final DateClientParam EXPIRY = new DateClientParam(SP_EXPIRY); - - /** - * Search parameter constant for quantity - *

- * Description:
- * Type: number
- * Path: Substance.instance.quantity
- *

- */ - @SearchParamDefinition(name="quantity", path="Substance.instance.quantity", description="", type="number" ) - public static final String SP_QUANTITY = "quantity"; - - /** - * Fluent Client search parameter constant for quantity - *

- * Description:
- * Type: number
- * Path: Substance.instance.quantity
- *

- */ - public static final NumberClientParam QUANTITY = new NumberClientParam(SP_QUANTITY); - - /** - * Search parameter constant for substance - *

- * Description:
- * Type: reference
- * Path: Substance.ingredient.substance
- *

- */ - @SearchParamDefinition(name="substance", path="Substance.ingredient.substance", description="", type="reference" ) - public static final String SP_SUBSTANCE = "substance"; - - /** - * Fluent Client search parameter constant for substance - *

- * Description:
- * Type: reference
- * Path: Substance.ingredient.substance
- *

- */ - public static final ReferenceClientParam SUBSTANCE = new ReferenceClientParam(SP_SUBSTANCE); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Substance.ingredient.substance". - */ - public static final Include INCLUDE_INGREDIENT_SUBSTANCE = new Include("Substance.ingredient.substance"); - - - @Child(name="type", type=CodeableConceptDt.class, order=0, min=1, max=1) - @Description( - shortDefinition="What kind of substance this is", - formalDefinition="A code (or set of codes) that identify this substance" - ) - private BoundCodeableConceptDt myType; - - @Child(name="description", type=StringDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Textual description of the substance, comments", - formalDefinition="A description of the substance - its appearance, handling requirements, and other usage notes" - ) - private StringDt myDescription; - - @Child(name="instance", order=2, min=0, max=1) - @Description( - shortDefinition="If this describes a specific package/container of the substance", - formalDefinition="Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance" - ) - private Instance myInstance; - - @Child(name="ingredient", order=3, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Composition information about the substance", - formalDefinition="A substance can be composed of other substances" - ) - private java.util.List myIngredient; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myType, myDescription, myInstance, myIngredient); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myType, myDescription, myInstance, myIngredient); - } - - /** - * Gets the value(s) for type (What kind of substance this is). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A code (or set of codes) that identify this substance - *

- */ - public BoundCodeableConceptDt getType() { - if (myType == null) { - myType = new BoundCodeableConceptDt(SubstanceTypeEnum.VALUESET_BINDER); - } - return myType; - } - - /** - * Sets the value(s) for type (What kind of substance this is) - * - *

- * Definition: - * A code (or set of codes) that identify this substance - *

- */ - public Substance setType(BoundCodeableConceptDt theValue) { - myType = theValue; - return this; - } - - /** - * Sets the value(s) for type (What kind of substance this is) - * - *

- * Definition: - * A code (or set of codes) that identify this substance - *

- */ - public Substance setType(SubstanceTypeEnum theValue) { - getType().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for description (Textual description of the substance, comments). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A description of the substance - its appearance, handling requirements, and other usage notes - *

- */ - public StringDt getDescription() { - if (myDescription == null) { - myDescription = new StringDt(); - } - return myDescription; - } - - /** - * Sets the value(s) for description (Textual description of the substance, comments) - * - *

- * Definition: - * A description of the substance - its appearance, handling requirements, and other usage notes - *

- */ - public Substance setDescription(StringDt theValue) { - myDescription = theValue; - return this; - } - - /** - * Sets the value for description (Textual description of the substance, comments) - * - *

- * Definition: - * A description of the substance - its appearance, handling requirements, and other usage notes - *

- */ - public Substance setDescription( String theString) { - myDescription = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for instance (If this describes a specific package/container of the substance). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance - *

- */ - public Instance getInstance() { - if (myInstance == null) { - myInstance = new Instance(); - } - return myInstance; - } - - /** - * Sets the value(s) for instance (If this describes a specific package/container of the substance) - * - *

- * Definition: - * Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance - *

- */ - public Substance setInstance(Instance theValue) { - myInstance = theValue; - return this; - } - - - /** - * Gets the value(s) for ingredient (Composition information about the substance). - * creating it if it does - * not exist. Will not return null. - * - *

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

- */ - public java.util.List getIngredient() { - if (myIngredient == null) { - myIngredient = new java.util.ArrayList(); - } - return myIngredient; - } - - /** - * Sets the value(s) for ingredient (Composition information about the substance) - * - *

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

- */ - public Substance setIngredient(java.util.List theValue) { - myIngredient = theValue; - return this; - } - - /** - * Adds and returns a new value for ingredient (Composition information about the substance) - * - *

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

- */ - public Ingredient addIngredient() { - Ingredient newType = new Ingredient(); - getIngredient().add(newType); - return newType; - } - - /** - * Gets the first repetition for ingredient (Composition information about the substance), - * creating it if it does not already exist. - * - *

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

- */ - public Ingredient getIngredientFirstRep() { - if (getIngredient().isEmpty()) { - return addIngredient(); - } - return getIngredient().get(0); - } - - /** - * Block class for child element: Substance.instance (If this describes a specific package/container of the substance) - * - *

- * Definition: - * Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance - *

- */ - @Block() - public static class Instance extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Identifier of the package/container", - formalDefinition="Identifier associated with the package/container (usually a label affixed directly)" - ) - private IdentifierDt myIdentifier; - - @Child(name="expiry", type=DateTimeDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="When no longer valid to use", - formalDefinition="When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry." - ) - private DateTimeDt myExpiry; - - @Child(name="quantity", type=QuantityDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Amount of substance in the package", - formalDefinition="The amount of the substance" - ) - private QuantityDt myQuantity; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myExpiry, myQuantity); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myExpiry, myQuantity); - } - - /** - * Gets the value(s) for identifier (Identifier of the package/container). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifier associated with the package/container (usually a label affixed directly) - *

- */ - public IdentifierDt getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new IdentifierDt(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Identifier of the package/container) - * - *

- * Definition: - * Identifier associated with the package/container (usually a label affixed directly) - *

- */ - public Instance setIdentifier(IdentifierDt theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Sets the value for identifier (Identifier of the package/container) - * - *

- * Definition: - * Identifier associated with the package/container (usually a label affixed directly) - *

- */ - public Instance setIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - myIdentifier = new IdentifierDt(theUse, theSystem, theValue, theLabel); - return this; - } - - /** - * Sets the value for identifier (Identifier of the package/container) - * - *

- * Definition: - * Identifier associated with the package/container (usually a label affixed directly) - *

- */ - public Instance setIdentifier( String theSystem, String theValue) { - myIdentifier = new IdentifierDt(theSystem, theValue); - return this; - } - - - /** - * Gets the value(s) for expiry (When no longer valid to use). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. - *

- */ - public DateTimeDt getExpiry() { - if (myExpiry == null) { - myExpiry = new DateTimeDt(); - } - return myExpiry; - } - - /** - * Sets the value(s) for expiry (When no longer valid to use) - * - *

- * Definition: - * When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. - *

- */ - public Instance setExpiry(DateTimeDt theValue) { - myExpiry = theValue; - return this; - } - - /** - * Sets the value for expiry (When no longer valid to use) - * - *

- * Definition: - * When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. - *

- */ - public Instance setExpiryWithSecondsPrecision( Date theDate) { - myExpiry = new DateTimeDt(theDate); - return this; - } - - /** - * Sets the value for expiry (When no longer valid to use) - * - *

- * Definition: - * When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. - *

- */ - public Instance setExpiry( Date theDate, TemporalPrecisionEnum thePrecision) { - myExpiry = new DateTimeDt(theDate, thePrecision); - return this; - } - - - /** - * Gets the value(s) for quantity (Amount of substance in the package). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The amount of the substance - *

- */ - public QuantityDt getQuantity() { - if (myQuantity == null) { - myQuantity = new QuantityDt(); - } - return myQuantity; - } - - /** - * Sets the value(s) for quantity (Amount of substance in the package) - * - *

- * Definition: - * The amount of the substance - *

- */ - public Instance setQuantity(QuantityDt theValue) { - myQuantity = theValue; - return this; - } - - /** - * Sets the value for quantity (Amount of substance in the package) - * - *

- * Definition: - * The amount of the substance - *

- */ - public Instance setQuantity( QuantityCompararatorEnum theComparator, double theValue, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for quantity (Amount of substance in the package) - * - *

- * Definition: - * The amount of the substance - *

- */ - public Instance setQuantity( QuantityCompararatorEnum theComparator, long theValue, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for quantity (Amount of substance in the package) - * - *

- * Definition: - * The amount of the substance - *

- */ - public Instance setQuantity( QuantityCompararatorEnum theComparator, double theValue, String theSystem, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for quantity (Amount of substance in the package) - * - *

- * Definition: - * The amount of the substance - *

- */ - public Instance setQuantity( QuantityCompararatorEnum theComparator, long theValue, String theSystem, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for quantity (Amount of substance in the package) - * - *

- * Definition: - * The amount of the substance - *

- */ - public Instance setQuantity( double theValue) { - myQuantity = new QuantityDt(theValue); - return this; - } - - /** - * Sets the value for quantity (Amount of substance in the package) - * - *

- * Definition: - * The amount of the substance - *

- */ - public Instance setQuantity( long theValue) { - myQuantity = new QuantityDt(theValue); - return this; - } - - - - } - - - /** - * Block class for child element: Substance.ingredient (Composition information about the substance) - * - *

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

- */ - @Block() - public static class Ingredient extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="quantity", type=RatioDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="Optional amount (concentration)", - formalDefinition="The amount of the ingredient in the substance - a concentration ratio" - ) - private RatioDt myQuantity; - - @Child(name="substance", order=1, min=1, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Substance.class }) - @Description( - shortDefinition="A component of the substance", - formalDefinition="Another substance that is a component of this substance" - ) - private ResourceReferenceDt mySubstance; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myQuantity, mySubstance); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myQuantity, mySubstance); - } - - /** - * Gets the value(s) for quantity (Optional amount (concentration)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The amount of the ingredient in the substance - a concentration ratio - *

- */ - public RatioDt getQuantity() { - if (myQuantity == null) { - myQuantity = new RatioDt(); - } - return myQuantity; - } - - /** - * Sets the value(s) for quantity (Optional amount (concentration)) - * - *

- * Definition: - * The amount of the ingredient in the substance - a concentration ratio - *

- */ - public Ingredient setQuantity(RatioDt theValue) { - myQuantity = theValue; - return this; - } - - - /** - * Gets the value(s) for substance (A component of the substance). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Another substance that is a component of this substance - *

- */ - public ResourceReferenceDt getSubstance() { - if (mySubstance == null) { - mySubstance = new ResourceReferenceDt(); - } - return mySubstance; - } - - /** - * Sets the value(s) for substance (A component of the substance) - * - *

- * Definition: - * Another substance that is a component of this substance - *

- */ - public Ingredient setSubstance(ResourceReferenceDt theValue) { - mySubstance = theValue; - return this; - } - - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Supply.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Supply.java deleted file mode 100644 index 20ece25f013..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Supply.java +++ /dev/null @@ -1,1131 +0,0 @@ - - - - - - - - - - - - - - - - -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.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.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.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; -import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; -import ca.uhn.fhir.model.dstu.valueset.SupplyDispenseStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.SupplyItemTypeEnum; -import ca.uhn.fhir.model.dstu.valueset.SupplyStatusEnum; -import ca.uhn.fhir.model.dstu.valueset.SupplyTypeEnum; -import ca.uhn.fhir.model.primitive.BoundCodeDt; -import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; -import ca.uhn.fhir.model.primitive.CodeDt; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR Supply Resource - * (A supply - request and provision) - * - *

- * Definition: - * A supply - a request for something, and provision of what is supplied - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Supply - *

- * - */ -@ResourceDef(name="Supply", profile="http://hl7.org/fhir/profiles/Supply", id="supply") -public class Supply extends BaseResource implements IResource { - - /** - * Search parameter constant for kind - *

- * Description:
- * Type: token
- * Path: Supply.kind
- *

- */ - @SearchParamDefinition(name="kind", path="Supply.kind", description="", type="token" ) - public static final String SP_KIND = "kind"; - - /** - * Fluent Client search parameter constant for kind - *

- * Description:
- * Type: token
- * Path: Supply.kind
- *

- */ - public static final TokenClientParam KIND = new TokenClientParam(SP_KIND); - - /** - * Search parameter constant for identifier - *

- * Description:
- * Type: token
- * Path: Supply.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Supply.identifier", description="", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - - /** - * Fluent Client search parameter constant for identifier - *

- * Description:
- * Type: token
- * Path: Supply.identifier
- *

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

- * Description:
- * Type: token
- * Path: Supply.status
- *

- */ - @SearchParamDefinition(name="status", path="Supply.status", description="", type="token" ) - public static final String SP_STATUS = "status"; - - /** - * Fluent Client search parameter constant for status - *

- * Description:
- * Type: token
- * Path: Supply.status
- *

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

- * Description:
- * Type: reference
- * Path: Supply.patient
- *

- */ - @SearchParamDefinition(name="patient", path="Supply.patient", description="", type="reference" ) - public static final String SP_PATIENT = "patient"; - - /** - * Fluent Client search parameter constant for patient - *

- * Description:
- * Type: reference
- * Path: Supply.patient
- *

- */ - public static final ReferenceClientParam PATIENT = new ReferenceClientParam(SP_PATIENT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Supply.patient". - */ - public static final Include INCLUDE_PATIENT = new Include("Supply.patient"); - - /** - * Search parameter constant for supplier - *

- * Description:
- * Type: reference
- * Path: Supply.dispense.supplier
- *

- */ - @SearchParamDefinition(name="supplier", path="Supply.dispense.supplier", description="", type="reference" ) - public static final String SP_SUPPLIER = "supplier"; - - /** - * Fluent Client search parameter constant for supplier - *

- * Description:
- * Type: reference
- * Path: Supply.dispense.supplier
- *

- */ - public static final ReferenceClientParam SUPPLIER = new ReferenceClientParam(SP_SUPPLIER); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Supply.dispense.supplier". - */ - public static final Include INCLUDE_DISPENSE_SUPPLIER = new Include("Supply.dispense.supplier"); - - /** - * Search parameter constant for dispenseid - *

- * Description:
- * Type: token
- * Path: Supply.dispense.identifier
- *

- */ - @SearchParamDefinition(name="dispenseid", path="Supply.dispense.identifier", description="", type="token" ) - public static final String SP_DISPENSEID = "dispenseid"; - - /** - * Fluent Client search parameter constant for dispenseid - *

- * Description:
- * Type: token
- * Path: Supply.dispense.identifier
- *

- */ - public static final TokenClientParam DISPENSEID = new TokenClientParam(SP_DISPENSEID); - - /** - * Search parameter constant for dispensestatus - *

- * Description:
- * Type: token
- * Path: Supply.dispense.status
- *

- */ - @SearchParamDefinition(name="dispensestatus", path="Supply.dispense.status", description="", type="token" ) - public static final String SP_DISPENSESTATUS = "dispensestatus"; - - /** - * Fluent Client search parameter constant for dispensestatus - *

- * Description:
- * Type: token
- * Path: Supply.dispense.status
- *

- */ - public static final TokenClientParam DISPENSESTATUS = new TokenClientParam(SP_DISPENSESTATUS); - - - @Child(name="kind", type=CodeableConceptDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="The kind of supply (central, non-stock, etc)", - formalDefinition="Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process" - ) - private BoundCodeableConceptDt myKind; - - @Child(name="identifier", type=IdentifierDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Unique identifier", - formalDefinition="Unique identifier for this supply request" - ) - private IdentifierDt myIdentifier; - - @Child(name="status", type=CodeDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="requested | dispensed | received | failed | cancelled", - formalDefinition="Status of the supply request" - ) - private BoundCodeDt myStatus; - - @Child(name="orderedItem", order=3, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Medication.class, ca.uhn.fhir.model.dstu.resource.Substance.class, ca.uhn.fhir.model.dstu.resource.Device.class }) - @Description( - shortDefinition="Medication, Substance, or Device requested to be supplied", - formalDefinition="The item that is requested to be supplied" - ) - private ResourceReferenceDt myOrderedItem; - - @Child(name="patient", order=4, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="Patient for whom the item is supplied", - formalDefinition="A link to a resource representing the person whom the ordered item is for" - ) - private ResourceReferenceDt myPatient; - - @Child(name="dispense", order=5, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Supply details", - formalDefinition="Indicates the details of the dispense event such as the days supply and quantity of a supply dispensed." - ) - private java.util.List myDispense; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myKind, myIdentifier, myStatus, myOrderedItem, myPatient, myDispense); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myKind, myIdentifier, myStatus, myOrderedItem, myPatient, myDispense); - } - - /** - * Gets the value(s) for kind (The kind of supply (central, non-stock, etc)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process - *

- */ - public BoundCodeableConceptDt getKind() { - if (myKind == null) { - myKind = new BoundCodeableConceptDt(SupplyTypeEnum.VALUESET_BINDER); - } - return myKind; - } - - /** - * Sets the value(s) for kind (The kind of supply (central, non-stock, etc)) - * - *

- * Definition: - * Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process - *

- */ - public Supply setKind(BoundCodeableConceptDt theValue) { - myKind = theValue; - return this; - } - - /** - * Sets the value(s) for kind (The kind of supply (central, non-stock, etc)) - * - *

- * Definition: - * Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process - *

- */ - public Supply setKind(SupplyTypeEnum theValue) { - getKind().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for identifier (Unique identifier). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Unique identifier for this supply request - *

- */ - public IdentifierDt getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new IdentifierDt(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (Unique identifier) - * - *

- * Definition: - * Unique identifier for this supply request - *

- */ - public Supply setIdentifier(IdentifierDt theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Sets the value for identifier (Unique identifier) - * - *

- * Definition: - * Unique identifier for this supply request - *

- */ - public Supply setIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - myIdentifier = new IdentifierDt(theUse, theSystem, theValue, theLabel); - return this; - } - - /** - * Sets the value for identifier (Unique identifier) - * - *

- * Definition: - * Unique identifier for this supply request - *

- */ - public Supply setIdentifier( String theSystem, String theValue) { - myIdentifier = new IdentifierDt(theSystem, theValue); - return this; - } - - - /** - * Gets the value(s) for status (requested | dispensed | received | failed | cancelled). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Status of the supply request - *

- */ - public BoundCodeDt getStatus() { - if (myStatus == null) { - myStatus = new BoundCodeDt(SupplyStatusEnum.VALUESET_BINDER); - } - return myStatus; - } - - /** - * Sets the value(s) for status (requested | dispensed | received | failed | cancelled) - * - *

- * Definition: - * Status of the supply request - *

- */ - public Supply setStatus(BoundCodeDt theValue) { - myStatus = theValue; - return this; - } - - /** - * Sets the value(s) for status (requested | dispensed | received | failed | cancelled) - * - *

- * Definition: - * Status of the supply request - *

- */ - public Supply setStatus(SupplyStatusEnum theValue) { - getStatus().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for orderedItem (Medication, Substance, or Device requested to be supplied). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The item that is requested to be supplied - *

- */ - public ResourceReferenceDt getOrderedItem() { - if (myOrderedItem == null) { - myOrderedItem = new ResourceReferenceDt(); - } - return myOrderedItem; - } - - /** - * Sets the value(s) for orderedItem (Medication, Substance, or Device requested to be supplied) - * - *

- * Definition: - * The item that is requested to be supplied - *

- */ - public Supply setOrderedItem(ResourceReferenceDt theValue) { - myOrderedItem = theValue; - return this; - } - - - /** - * Gets the value(s) for patient (Patient for whom the item is supplied). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A link to a resource representing the person whom the ordered item is for - *

- */ - public ResourceReferenceDt getPatient() { - if (myPatient == null) { - myPatient = new ResourceReferenceDt(); - } - return myPatient; - } - - /** - * Sets the value(s) for patient (Patient for whom the item is supplied) - * - *

- * Definition: - * A link to a resource representing the person whom the ordered item is for - *

- */ - public Supply setPatient(ResourceReferenceDt theValue) { - myPatient = theValue; - return this; - } - - - /** - * Gets the value(s) for dispense (Supply details). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates the details of the dispense event such as the days supply and quantity of a supply dispensed. - *

- */ - public java.util.List getDispense() { - if (myDispense == null) { - myDispense = new java.util.ArrayList(); - } - return myDispense; - } - - /** - * Sets the value(s) for dispense (Supply details) - * - *

- * Definition: - * Indicates the details of the dispense event such as the days supply and quantity of a supply dispensed. - *

- */ - public Supply setDispense(java.util.List theValue) { - myDispense = theValue; - return this; - } - - /** - * Adds and returns a new value for dispense (Supply details) - * - *

- * Definition: - * Indicates the details of the dispense event such as the days supply and quantity of a supply dispensed. - *

- */ - public Dispense addDispense() { - Dispense newType = new Dispense(); - getDispense().add(newType); - return newType; - } - - /** - * Gets the first repetition for dispense (Supply details), - * creating it if it does not already exist. - * - *

- * Definition: - * Indicates the details of the dispense event such as the days supply and quantity of a supply dispensed. - *

- */ - public Dispense getDispenseFirstRep() { - if (getDispense().isEmpty()) { - return addDispense(); - } - return getDispense().get(0); - } - - /** - * Block class for child element: Supply.dispense (Supply details) - * - *

- * Definition: - * Indicates the details of the dispense event such as the days supply and quantity of a supply dispensed. - *

- */ - @Block() - public static class Dispense extends BaseIdentifiableElement implements IResourceBlock { - - @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="External identifier", - formalDefinition="Identifier assigned by the dispensing facility when the dispense occurs" - ) - private IdentifierDt myIdentifier; - - @Child(name="status", type=CodeDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="in progress | dispensed | abandoned", - formalDefinition="A code specifying the state of the dispense event." - ) - private BoundCodeDt myStatus; - - @Child(name="type", type=CodeableConceptDt.class, order=2, min=0, max=1) - @Description( - shortDefinition="Category of dispense event", - formalDefinition="Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc." - ) - private BoundCodeableConceptDt myType; - - @Child(name="quantity", type=QuantityDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="Amount dispensed", - formalDefinition="The amount of supply that has been dispensed. Includes unit of measure." - ) - private QuantityDt myQuantity; - - @Child(name="suppliedItem", order=4, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Medication.class, ca.uhn.fhir.model.dstu.resource.Substance.class, ca.uhn.fhir.model.dstu.resource.Device.class }) - @Description( - shortDefinition="Medication, Substance, or Device supplied", - formalDefinition="Identifies the medication or substance being dispensed. This is either a link to a resource representing the details of the medication or substance or a simple attribute carrying a code that identifies the medication from a known list of medications." - ) - private ResourceReferenceDt mySuppliedItem; - - @Child(name="supplier", order=5, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class }) - @Description( - shortDefinition="Dispenser", - formalDefinition="The individual responsible for dispensing the medication" - ) - private ResourceReferenceDt mySupplier; - - @Child(name="whenPrepared", type=PeriodDt.class, order=6, min=0, max=1) - @Description( - shortDefinition="Dispensing time", - formalDefinition="The time the dispense event occurred." - ) - private PeriodDt myWhenPrepared; - - @Child(name="whenHandedOver", type=PeriodDt.class, order=7, min=0, max=1) - @Description( - shortDefinition="Handover time", - formalDefinition="The time the dispensed item was sent or handed to the patient (or agent)." - ) - private PeriodDt myWhenHandedOver; - - @Child(name="destination", order=8, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Location.class }) - @Description( - shortDefinition="Where the Supply was sent", - formalDefinition="Identification of the facility/location where the Supply was shipped to, as part of the dispense event." - ) - private ResourceReferenceDt myDestination; - - @Child(name="receiver", order=9, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Practitioner.class }) - @Description( - shortDefinition="Who collected the Supply", - formalDefinition="Identifies the person who picked up the Supply." - ) - private java.util.List myReceiver; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myStatus, myType, myQuantity, mySuppliedItem, mySupplier, myWhenPrepared, myWhenHandedOver, myDestination, myReceiver); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myStatus, myType, myQuantity, mySuppliedItem, mySupplier, myWhenPrepared, myWhenHandedOver, myDestination, myReceiver); - } - - /** - * Gets the value(s) for identifier (External identifier). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifier assigned by the dispensing facility when the dispense occurs - *

- */ - public IdentifierDt getIdentifier() { - if (myIdentifier == null) { - myIdentifier = new IdentifierDt(); - } - return myIdentifier; - } - - /** - * Sets the value(s) for identifier (External identifier) - * - *

- * Definition: - * Identifier assigned by the dispensing facility when the dispense occurs - *

- */ - public Dispense setIdentifier(IdentifierDt theValue) { - myIdentifier = theValue; - return this; - } - - /** - * Sets the value for identifier (External identifier) - * - *

- * Definition: - * Identifier assigned by the dispensing facility when the dispense occurs - *

- */ - public Dispense setIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) { - myIdentifier = new IdentifierDt(theUse, theSystem, theValue, theLabel); - return this; - } - - /** - * Sets the value for identifier (External identifier) - * - *

- * Definition: - * Identifier assigned by the dispensing facility when the dispense occurs - *

- */ - public Dispense setIdentifier( String theSystem, String theValue) { - myIdentifier = new IdentifierDt(theSystem, theValue); - return this; - } - - - /** - * Gets the value(s) for status (in progress | dispensed | abandoned). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * A code specifying the state of the dispense event. - *

- */ - public BoundCodeDt getStatus() { - if (myStatus == null) { - myStatus = new BoundCodeDt(SupplyDispenseStatusEnum.VALUESET_BINDER); - } - return myStatus; - } - - /** - * Sets the value(s) for status (in progress | dispensed | abandoned) - * - *

- * Definition: - * A code specifying the state of the dispense event. - *

- */ - public Dispense setStatus(BoundCodeDt theValue) { - myStatus = theValue; - return this; - } - - /** - * Sets the value(s) for status (in progress | dispensed | abandoned) - * - *

- * Definition: - * A code specifying the state of the dispense event. - *

- */ - public Dispense setStatus(SupplyDispenseStatusEnum theValue) { - getStatus().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for type (Category of dispense event). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc. - *

- */ - public BoundCodeableConceptDt getType() { - if (myType == null) { - myType = new BoundCodeableConceptDt(SupplyItemTypeEnum.VALUESET_BINDER); - } - return myType; - } - - /** - * Sets the value(s) for type (Category of dispense event) - * - *

- * Definition: - * Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc. - *

- */ - public Dispense setType(BoundCodeableConceptDt theValue) { - myType = theValue; - return this; - } - - /** - * Sets the value(s) for type (Category of dispense event) - * - *

- * Definition: - * Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc. - *

- */ - public Dispense setType(SupplyItemTypeEnum theValue) { - getType().setValueAsEnum(theValue); - return this; - } - - - /** - * Gets the value(s) for quantity (Amount dispensed). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The amount of supply that has been dispensed. Includes unit of measure. - *

- */ - public QuantityDt getQuantity() { - if (myQuantity == null) { - myQuantity = new QuantityDt(); - } - return myQuantity; - } - - /** - * Sets the value(s) for quantity (Amount dispensed) - * - *

- * Definition: - * The amount of supply that has been dispensed. Includes unit of measure. - *

- */ - public Dispense setQuantity(QuantityDt theValue) { - myQuantity = theValue; - return this; - } - - /** - * Sets the value for quantity (Amount dispensed) - * - *

- * Definition: - * The amount of supply that has been dispensed. Includes unit of measure. - *

- */ - public Dispense setQuantity( QuantityCompararatorEnum theComparator, double theValue, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for quantity (Amount dispensed) - * - *

- * Definition: - * The amount of supply that has been dispensed. Includes unit of measure. - *

- */ - public Dispense setQuantity( QuantityCompararatorEnum theComparator, long theValue, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theUnits); - return this; - } - - /** - * Sets the value for quantity (Amount dispensed) - * - *

- * Definition: - * The amount of supply that has been dispensed. Includes unit of measure. - *

- */ - public Dispense setQuantity( QuantityCompararatorEnum theComparator, double theValue, String theSystem, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for quantity (Amount dispensed) - * - *

- * Definition: - * The amount of supply that has been dispensed. Includes unit of measure. - *

- */ - public Dispense setQuantity( QuantityCompararatorEnum theComparator, long theValue, String theSystem, String theUnits) { - myQuantity = new QuantityDt(theComparator, theValue, theSystem, theUnits); - return this; - } - - /** - * Sets the value for quantity (Amount dispensed) - * - *

- * Definition: - * The amount of supply that has been dispensed. Includes unit of measure. - *

- */ - public Dispense setQuantity( double theValue) { - myQuantity = new QuantityDt(theValue); - return this; - } - - /** - * Sets the value for quantity (Amount dispensed) - * - *

- * Definition: - * The amount of supply that has been dispensed. Includes unit of measure. - *

- */ - public Dispense setQuantity( long theValue) { - myQuantity = new QuantityDt(theValue); - return this; - } - - - /** - * Gets the value(s) for suppliedItem (Medication, Substance, or Device supplied). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the medication or substance being dispensed. This is either a link to a resource representing the details of the medication or substance or a simple attribute carrying a code that identifies the medication from a known list of medications. - *

- */ - public ResourceReferenceDt getSuppliedItem() { - if (mySuppliedItem == null) { - mySuppliedItem = new ResourceReferenceDt(); - } - return mySuppliedItem; - } - - /** - * Sets the value(s) for suppliedItem (Medication, Substance, or Device supplied) - * - *

- * Definition: - * Identifies the medication or substance being dispensed. This is either a link to a resource representing the details of the medication or substance or a simple attribute carrying a code that identifies the medication from a known list of medications. - *

- */ - public Dispense setSuppliedItem(ResourceReferenceDt theValue) { - mySuppliedItem = theValue; - return this; - } - - - /** - * Gets the value(s) for supplier (Dispenser). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The individual responsible for dispensing the medication - *

- */ - public ResourceReferenceDt getSupplier() { - if (mySupplier == null) { - mySupplier = new ResourceReferenceDt(); - } - return mySupplier; - } - - /** - * Sets the value(s) for supplier (Dispenser) - * - *

- * Definition: - * The individual responsible for dispensing the medication - *

- */ - public Dispense setSupplier(ResourceReferenceDt theValue) { - mySupplier = theValue; - return this; - } - - - /** - * Gets the value(s) for whenPrepared (Dispensing time). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The time the dispense event occurred. - *

- */ - public PeriodDt getWhenPrepared() { - if (myWhenPrepared == null) { - myWhenPrepared = new PeriodDt(); - } - return myWhenPrepared; - } - - /** - * Sets the value(s) for whenPrepared (Dispensing time) - * - *

- * Definition: - * The time the dispense event occurred. - *

- */ - public Dispense setWhenPrepared(PeriodDt theValue) { - myWhenPrepared = theValue; - return this; - } - - - /** - * Gets the value(s) for whenHandedOver (Handover time). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * The time the dispensed item was sent or handed to the patient (or agent). - *

- */ - public PeriodDt getWhenHandedOver() { - if (myWhenHandedOver == null) { - myWhenHandedOver = new PeriodDt(); - } - return myWhenHandedOver; - } - - /** - * Sets the value(s) for whenHandedOver (Handover time) - * - *

- * Definition: - * The time the dispensed item was sent or handed to the patient (or agent). - *

- */ - public Dispense setWhenHandedOver(PeriodDt theValue) { - myWhenHandedOver = theValue; - return this; - } - - - /** - * Gets the value(s) for destination (Where the Supply was sent). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identification of the facility/location where the Supply was shipped to, as part of the dispense event. - *

- */ - public ResourceReferenceDt getDestination() { - if (myDestination == null) { - myDestination = new ResourceReferenceDt(); - } - return myDestination; - } - - /** - * Sets the value(s) for destination (Where the Supply was sent) - * - *

- * Definition: - * Identification of the facility/location where the Supply was shipped to, as part of the dispense event. - *

- */ - public Dispense setDestination(ResourceReferenceDt theValue) { - myDestination = theValue; - return this; - } - - - /** - * Gets the value(s) for receiver (Who collected the Supply). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * Identifies the person who picked up the Supply. - *

- */ - public java.util.List getReceiver() { - if (myReceiver == null) { - myReceiver = new java.util.ArrayList(); - } - return myReceiver; - } - - /** - * Sets the value(s) for receiver (Who collected the Supply) - * - *

- * Definition: - * Identifies the person who picked up the Supply. - *

- */ - public Dispense setReceiver(java.util.List theValue) { - myReceiver = theValue; - return this; - } - - /** - * Adds and returns a new value for receiver (Who collected the Supply) - * - *

- * Definition: - * Identifies the person who picked up the Supply. - *

- */ - public ResourceReferenceDt addReceiver() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getReceiver().add(newType); - return newType; - } - - - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Test.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Test.java deleted file mode 100644 index 1302b654641..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Test.java +++ /dev/null @@ -1,1433 +0,0 @@ - - - - - - - - - - - - - - - - -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.BaseResource; -import ca.uhn.fhir.model.api.IElement; -import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.api.TemporalPrecisionEnum; -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.Description; -import ca.uhn.fhir.model.api.annotation.ResourceDef; -import ca.uhn.fhir.model.primitive.Base64BinaryDt; -import ca.uhn.fhir.model.primitive.BooleanDt; -import ca.uhn.fhir.model.primitive.DecimalDt; -import ca.uhn.fhir.model.primitive.IdrefDt; -import ca.uhn.fhir.model.primitive.InstantDt; -import ca.uhn.fhir.model.primitive.IntegerDt; -import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.primitive.UriDt; - - -/** - * HAPI/FHIR Test Resource - * (Test's Resource) - * - *

- * Definition: - * [Template] Master Definition - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/Test - *

- * - */ -@ResourceDef(name="Test", profile="http://hl7.org/fhir/profiles/Test", id="test") -public class Test extends BaseResource implements IResource { - - - @Child(name="stringErr", type=StringDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Strings with invalid content", - formalDefinition="" - ) - private java.util.List myStringErr; - - @Child(name="stringCorr", type=StringDt.class, order=1, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Strings with correct content", - formalDefinition="" - ) - private java.util.List myStringCorr; - - @Child(name="booleanErr", type=BooleanDt.class, order=2, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Booleans with invalid content", - formalDefinition="" - ) - private java.util.List myBooleanErr; - - @Child(name="booleanCorr", type=BooleanDt.class, order=3, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Booleans with correct content", - formalDefinition="" - ) - private java.util.List myBooleanCorr; - - @Child(name="integerErr", type=IntegerDt.class, order=4, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Integers with invalid content", - formalDefinition="" - ) - private java.util.List myIntegerErr; - - @Child(name="integerCorr", type=IntegerDt.class, order=5, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Integers with correct content", - formalDefinition="" - ) - private java.util.List myIntegerCorr; - - @Child(name="decimalErr", type=DecimalDt.class, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Decimals with invalid content", - formalDefinition="" - ) - private java.util.List myDecimalErr; - - @Child(name="decimalCorr", type=DecimalDt.class, order=7, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Decimals with correct content", - formalDefinition="" - ) - private java.util.List myDecimalCorr; - - @Child(name="b64Err", type=Base64BinaryDt.class, order=8, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Binaries with invalid content", - formalDefinition="" - ) - private java.util.List myB64Err; - - @Child(name="b64Corr", type=Base64BinaryDt.class, order=9, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Binaries with correct content", - formalDefinition="" - ) - private java.util.List myB64Corr; - - @Child(name="instantErr", type=InstantDt.class, order=10, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Instants with invalid content", - formalDefinition="" - ) - private java.util.List myInstantErr; - - @Child(name="instantCorr", type=InstantDt.class, order=11, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Instants with correct content", - formalDefinition="" - ) - private java.util.List myInstantCorr; - - @Child(name="uriErr", type=UriDt.class, order=12, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Uri's with invalid content", - formalDefinition="" - ) - private java.util.List myUriErr; - - @Child(name="uriCorr", type=UriDt.class, order=13, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Uri's with correct content", - formalDefinition="" - ) - private java.util.List myUriCorr; - - @Child(name="idrefSingle", type=IdrefDt.class, order=14, min=0, max=1) - @Description( - shortDefinition="Test idref", - formalDefinition="" - ) - private IdrefDt myIdrefSingle; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myStringErr, myStringCorr, myBooleanErr, myBooleanCorr, myIntegerErr, myIntegerCorr, myDecimalErr, myDecimalCorr, myB64Err, myB64Corr, myInstantErr, myInstantCorr, myUriErr, myUriCorr, myIdrefSingle); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myStringErr, myStringCorr, myBooleanErr, myBooleanCorr, myIntegerErr, myIntegerCorr, myDecimalErr, myDecimalCorr, myB64Err, myB64Corr, myInstantErr, myInstantCorr, myUriErr, myUriCorr, myIdrefSingle); - } - - /** - * Gets the value(s) for stringErr (Strings with invalid content). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getStringErr() { - if (myStringErr == null) { - myStringErr = new java.util.ArrayList(); - } - return myStringErr; - } - - /** - * Sets the value(s) for stringErr (Strings with invalid content) - * - *

- * Definition: - * - *

- */ - public Test setStringErr(java.util.List theValue) { - myStringErr = theValue; - return this; - } - - /** - * Adds and returns a new value for stringErr (Strings with invalid content) - * - *

- * Definition: - * - *

- */ - public StringDt addStringErr() { - StringDt newType = new StringDt(); - getStringErr().add(newType); - return newType; - } - - /** - * Gets the first repetition for stringErr (Strings with invalid content), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public StringDt getStringErrFirstRep() { - if (getStringErr().isEmpty()) { - return addStringErr(); - } - return getStringErr().get(0); - } - /** - * Adds a new value for stringErr (Strings with invalid content) - * - *

- * Definition: - * - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Test addStringErr( String theString) { - if (myStringErr == null) { - myStringErr = new java.util.ArrayList(); - } - myStringErr.add(new StringDt(theString)); - return this; - } - - - /** - * Gets the value(s) for stringCorr (Strings with correct content). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getStringCorr() { - if (myStringCorr == null) { - myStringCorr = new java.util.ArrayList(); - } - return myStringCorr; - } - - /** - * Sets the value(s) for stringCorr (Strings with correct content) - * - *

- * Definition: - * - *

- */ - public Test setStringCorr(java.util.List theValue) { - myStringCorr = theValue; - return this; - } - - /** - * Adds and returns a new value for stringCorr (Strings with correct content) - * - *

- * Definition: - * - *

- */ - public StringDt addStringCorr() { - StringDt newType = new StringDt(); - getStringCorr().add(newType); - return newType; - } - - /** - * Gets the first repetition for stringCorr (Strings with correct content), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public StringDt getStringCorrFirstRep() { - if (getStringCorr().isEmpty()) { - return addStringCorr(); - } - return getStringCorr().get(0); - } - /** - * Adds a new value for stringCorr (Strings with correct content) - * - *

- * Definition: - * - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Test addStringCorr( String theString) { - if (myStringCorr == null) { - myStringCorr = new java.util.ArrayList(); - } - myStringCorr.add(new StringDt(theString)); - return this; - } - - - /** - * Gets the value(s) for booleanErr (Booleans with invalid content). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getBooleanErr() { - if (myBooleanErr == null) { - myBooleanErr = new java.util.ArrayList(); - } - return myBooleanErr; - } - - /** - * Sets the value(s) for booleanErr (Booleans with invalid content) - * - *

- * Definition: - * - *

- */ - public Test setBooleanErr(java.util.List theValue) { - myBooleanErr = theValue; - return this; - } - - /** - * Adds and returns a new value for booleanErr (Booleans with invalid content) - * - *

- * Definition: - * - *

- */ - public BooleanDt addBooleanErr() { - BooleanDt newType = new BooleanDt(); - getBooleanErr().add(newType); - return newType; - } - - /** - * Gets the first repetition for booleanErr (Booleans with invalid content), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public BooleanDt getBooleanErrFirstRep() { - if (getBooleanErr().isEmpty()) { - return addBooleanErr(); - } - return getBooleanErr().get(0); - } - /** - * Adds a new value for booleanErr (Booleans with invalid content) - * - *

- * Definition: - * - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Test addBooleanErr( boolean theBoolean) { - if (myBooleanErr == null) { - myBooleanErr = new java.util.ArrayList(); - } - myBooleanErr.add(new BooleanDt(theBoolean)); - return this; - } - - - /** - * Gets the value(s) for booleanCorr (Booleans with correct content). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getBooleanCorr() { - if (myBooleanCorr == null) { - myBooleanCorr = new java.util.ArrayList(); - } - return myBooleanCorr; - } - - /** - * Sets the value(s) for booleanCorr (Booleans with correct content) - * - *

- * Definition: - * - *

- */ - public Test setBooleanCorr(java.util.List theValue) { - myBooleanCorr = theValue; - return this; - } - - /** - * Adds and returns a new value for booleanCorr (Booleans with correct content) - * - *

- * Definition: - * - *

- */ - public BooleanDt addBooleanCorr() { - BooleanDt newType = new BooleanDt(); - getBooleanCorr().add(newType); - return newType; - } - - /** - * Gets the first repetition for booleanCorr (Booleans with correct content), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public BooleanDt getBooleanCorrFirstRep() { - if (getBooleanCorr().isEmpty()) { - return addBooleanCorr(); - } - return getBooleanCorr().get(0); - } - /** - * Adds a new value for booleanCorr (Booleans with correct content) - * - *

- * Definition: - * - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Test addBooleanCorr( boolean theBoolean) { - if (myBooleanCorr == null) { - myBooleanCorr = new java.util.ArrayList(); - } - myBooleanCorr.add(new BooleanDt(theBoolean)); - return this; - } - - - /** - * Gets the value(s) for integerErr (Integers with invalid content). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getIntegerErr() { - if (myIntegerErr == null) { - myIntegerErr = new java.util.ArrayList(); - } - return myIntegerErr; - } - - /** - * Sets the value(s) for integerErr (Integers with invalid content) - * - *

- * Definition: - * - *

- */ - public Test setIntegerErr(java.util.List theValue) { - myIntegerErr = theValue; - return this; - } - - /** - * Adds and returns a new value for integerErr (Integers with invalid content) - * - *

- * Definition: - * - *

- */ - public IntegerDt addIntegerErr() { - IntegerDt newType = new IntegerDt(); - getIntegerErr().add(newType); - return newType; - } - - /** - * Gets the first repetition for integerErr (Integers with invalid content), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public IntegerDt getIntegerErrFirstRep() { - if (getIntegerErr().isEmpty()) { - return addIntegerErr(); - } - return getIntegerErr().get(0); - } - /** - * Adds a new value for integerErr (Integers with invalid content) - * - *

- * Definition: - * - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Test addIntegerErr( int theInteger) { - if (myIntegerErr == null) { - myIntegerErr = new java.util.ArrayList(); - } - myIntegerErr.add(new IntegerDt(theInteger)); - return this; - } - - - /** - * Gets the value(s) for integerCorr (Integers with correct content). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getIntegerCorr() { - if (myIntegerCorr == null) { - myIntegerCorr = new java.util.ArrayList(); - } - return myIntegerCorr; - } - - /** - * Sets the value(s) for integerCorr (Integers with correct content) - * - *

- * Definition: - * - *

- */ - public Test setIntegerCorr(java.util.List theValue) { - myIntegerCorr = theValue; - return this; - } - - /** - * Adds and returns a new value for integerCorr (Integers with correct content) - * - *

- * Definition: - * - *

- */ - public IntegerDt addIntegerCorr() { - IntegerDt newType = new IntegerDt(); - getIntegerCorr().add(newType); - return newType; - } - - /** - * Gets the first repetition for integerCorr (Integers with correct content), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public IntegerDt getIntegerCorrFirstRep() { - if (getIntegerCorr().isEmpty()) { - return addIntegerCorr(); - } - return getIntegerCorr().get(0); - } - /** - * Adds a new value for integerCorr (Integers with correct content) - * - *

- * Definition: - * - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Test addIntegerCorr( int theInteger) { - if (myIntegerCorr == null) { - myIntegerCorr = new java.util.ArrayList(); - } - myIntegerCorr.add(new IntegerDt(theInteger)); - return this; - } - - - /** - * Gets the value(s) for decimalErr (Decimals with invalid content). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getDecimalErr() { - if (myDecimalErr == null) { - myDecimalErr = new java.util.ArrayList(); - } - return myDecimalErr; - } - - /** - * Sets the value(s) for decimalErr (Decimals with invalid content) - * - *

- * Definition: - * - *

- */ - public Test setDecimalErr(java.util.List theValue) { - myDecimalErr = theValue; - return this; - } - - /** - * Adds and returns a new value for decimalErr (Decimals with invalid content) - * - *

- * Definition: - * - *

- */ - public DecimalDt addDecimalErr() { - DecimalDt newType = new DecimalDt(); - getDecimalErr().add(newType); - return newType; - } - - /** - * Gets the first repetition for decimalErr (Decimals with invalid content), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public DecimalDt getDecimalErrFirstRep() { - if (getDecimalErr().isEmpty()) { - return addDecimalErr(); - } - return getDecimalErr().get(0); - } - /** - * Adds a new value for decimalErr (Decimals with invalid content) - * - *

- * Definition: - * - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Test addDecimalErr( long theValue) { - if (myDecimalErr == null) { - myDecimalErr = new java.util.ArrayList(); - } - myDecimalErr.add(new DecimalDt(theValue)); - return this; - } - - /** - * Adds a new value for decimalErr (Decimals with invalid content) - * - *

- * Definition: - * - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Test addDecimalErr( double theValue) { - if (myDecimalErr == null) { - myDecimalErr = new java.util.ArrayList(); - } - myDecimalErr.add(new DecimalDt(theValue)); - return this; - } - - /** - * Adds a new value for decimalErr (Decimals with invalid content) - * - *

- * Definition: - * - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Test addDecimalErr( java.math.BigDecimal theValue) { - if (myDecimalErr == null) { - myDecimalErr = new java.util.ArrayList(); - } - myDecimalErr.add(new DecimalDt(theValue)); - return this; - } - - - /** - * Gets the value(s) for decimalCorr (Decimals with correct content). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getDecimalCorr() { - if (myDecimalCorr == null) { - myDecimalCorr = new java.util.ArrayList(); - } - return myDecimalCorr; - } - - /** - * Sets the value(s) for decimalCorr (Decimals with correct content) - * - *

- * Definition: - * - *

- */ - public Test setDecimalCorr(java.util.List theValue) { - myDecimalCorr = theValue; - return this; - } - - /** - * Adds and returns a new value for decimalCorr (Decimals with correct content) - * - *

- * Definition: - * - *

- */ - public DecimalDt addDecimalCorr() { - DecimalDt newType = new DecimalDt(); - getDecimalCorr().add(newType); - return newType; - } - - /** - * Gets the first repetition for decimalCorr (Decimals with correct content), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public DecimalDt getDecimalCorrFirstRep() { - if (getDecimalCorr().isEmpty()) { - return addDecimalCorr(); - } - return getDecimalCorr().get(0); - } - /** - * Adds a new value for decimalCorr (Decimals with correct content) - * - *

- * Definition: - * - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Test addDecimalCorr( long theValue) { - if (myDecimalCorr == null) { - myDecimalCorr = new java.util.ArrayList(); - } - myDecimalCorr.add(new DecimalDt(theValue)); - return this; - } - - /** - * Adds a new value for decimalCorr (Decimals with correct content) - * - *

- * Definition: - * - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Test addDecimalCorr( double theValue) { - if (myDecimalCorr == null) { - myDecimalCorr = new java.util.ArrayList(); - } - myDecimalCorr.add(new DecimalDt(theValue)); - return this; - } - - /** - * Adds a new value for decimalCorr (Decimals with correct content) - * - *

- * Definition: - * - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Test addDecimalCorr( java.math.BigDecimal theValue) { - if (myDecimalCorr == null) { - myDecimalCorr = new java.util.ArrayList(); - } - myDecimalCorr.add(new DecimalDt(theValue)); - return this; - } - - - /** - * Gets the value(s) for b64Err (Binaries with invalid content). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getB64Err() { - if (myB64Err == null) { - myB64Err = new java.util.ArrayList(); - } - return myB64Err; - } - - /** - * Sets the value(s) for b64Err (Binaries with invalid content) - * - *

- * Definition: - * - *

- */ - public Test setB64Err(java.util.List theValue) { - myB64Err = theValue; - return this; - } - - /** - * Adds and returns a new value for b64Err (Binaries with invalid content) - * - *

- * Definition: - * - *

- */ - public Base64BinaryDt addB64Err() { - Base64BinaryDt newType = new Base64BinaryDt(); - getB64Err().add(newType); - return newType; - } - - /** - * Gets the first repetition for b64Err (Binaries with invalid content), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public Base64BinaryDt getB64ErrFirstRep() { - if (getB64Err().isEmpty()) { - return addB64Err(); - } - return getB64Err().get(0); - } - /** - * Adds a new value for b64Err (Binaries with invalid content) - * - *

- * Definition: - * - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Test addB64Err( byte[] theBytes) { - if (myB64Err == null) { - myB64Err = new java.util.ArrayList(); - } - myB64Err.add(new Base64BinaryDt(theBytes)); - return this; - } - - - /** - * Gets the value(s) for b64Corr (Binaries with correct content). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getB64Corr() { - if (myB64Corr == null) { - myB64Corr = new java.util.ArrayList(); - } - return myB64Corr; - } - - /** - * Sets the value(s) for b64Corr (Binaries with correct content) - * - *

- * Definition: - * - *

- */ - public Test setB64Corr(java.util.List theValue) { - myB64Corr = theValue; - return this; - } - - /** - * Adds and returns a new value for b64Corr (Binaries with correct content) - * - *

- * Definition: - * - *

- */ - public Base64BinaryDt addB64Corr() { - Base64BinaryDt newType = new Base64BinaryDt(); - getB64Corr().add(newType); - return newType; - } - - /** - * Gets the first repetition for b64Corr (Binaries with correct content), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public Base64BinaryDt getB64CorrFirstRep() { - if (getB64Corr().isEmpty()) { - return addB64Corr(); - } - return getB64Corr().get(0); - } - /** - * Adds a new value for b64Corr (Binaries with correct content) - * - *

- * Definition: - * - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Test addB64Corr( byte[] theBytes) { - if (myB64Corr == null) { - myB64Corr = new java.util.ArrayList(); - } - myB64Corr.add(new Base64BinaryDt(theBytes)); - return this; - } - - - /** - * Gets the value(s) for instantErr (Instants with invalid content). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getInstantErr() { - if (myInstantErr == null) { - myInstantErr = new java.util.ArrayList(); - } - return myInstantErr; - } - - /** - * Sets the value(s) for instantErr (Instants with invalid content) - * - *

- * Definition: - * - *

- */ - public Test setInstantErr(java.util.List theValue) { - myInstantErr = theValue; - return this; - } - - /** - * Adds and returns a new value for instantErr (Instants with invalid content) - * - *

- * Definition: - * - *

- */ - public InstantDt addInstantErr() { - InstantDt newType = new InstantDt(); - getInstantErr().add(newType); - return newType; - } - - /** - * Gets the first repetition for instantErr (Instants with invalid content), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public InstantDt getInstantErrFirstRep() { - if (getInstantErr().isEmpty()) { - return addInstantErr(); - } - return getInstantErr().get(0); - } - /** - * Adds a new value for instantErr (Instants with invalid content) - * - *

- * Definition: - * - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Test addInstantErr( Date theDate, TemporalPrecisionEnum thePrecision) { - if (myInstantErr == null) { - myInstantErr = new java.util.ArrayList(); - } - myInstantErr.add(new InstantDt(theDate, thePrecision)); - return this; - } - - /** - * Adds a new value for instantErr (Instants with invalid content) - * - *

- * Definition: - * - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Test addInstantErr( Date theDate) { - if (myInstantErr == null) { - myInstantErr = new java.util.ArrayList(); - } - myInstantErr.add(new InstantDt(theDate)); - return this; - } - - - /** - * Gets the value(s) for instantCorr (Instants with correct content). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getInstantCorr() { - if (myInstantCorr == null) { - myInstantCorr = new java.util.ArrayList(); - } - return myInstantCorr; - } - - /** - * Sets the value(s) for instantCorr (Instants with correct content) - * - *

- * Definition: - * - *

- */ - public Test setInstantCorr(java.util.List theValue) { - myInstantCorr = theValue; - return this; - } - - /** - * Adds and returns a new value for instantCorr (Instants with correct content) - * - *

- * Definition: - * - *

- */ - public InstantDt addInstantCorr() { - InstantDt newType = new InstantDt(); - getInstantCorr().add(newType); - return newType; - } - - /** - * Gets the first repetition for instantCorr (Instants with correct content), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public InstantDt getInstantCorrFirstRep() { - if (getInstantCorr().isEmpty()) { - return addInstantCorr(); - } - return getInstantCorr().get(0); - } - /** - * Adds a new value for instantCorr (Instants with correct content) - * - *

- * Definition: - * - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Test addInstantCorr( Date theDate, TemporalPrecisionEnum thePrecision) { - if (myInstantCorr == null) { - myInstantCorr = new java.util.ArrayList(); - } - myInstantCorr.add(new InstantDt(theDate, thePrecision)); - return this; - } - - /** - * Adds a new value for instantCorr (Instants with correct content) - * - *

- * Definition: - * - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Test addInstantCorr( Date theDate) { - if (myInstantCorr == null) { - myInstantCorr = new java.util.ArrayList(); - } - myInstantCorr.add(new InstantDt(theDate)); - return this; - } - - - /** - * Gets the value(s) for uriErr (Uri's with invalid content). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getUriErr() { - if (myUriErr == null) { - myUriErr = new java.util.ArrayList(); - } - return myUriErr; - } - - /** - * Sets the value(s) for uriErr (Uri's with invalid content) - * - *

- * Definition: - * - *

- */ - public Test setUriErr(java.util.List theValue) { - myUriErr = theValue; - return this; - } - - /** - * Adds and returns a new value for uriErr (Uri's with invalid content) - * - *

- * Definition: - * - *

- */ - public UriDt addUriErr() { - UriDt newType = new UriDt(); - getUriErr().add(newType); - return newType; - } - - /** - * Gets the first repetition for uriErr (Uri's with invalid content), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public UriDt getUriErrFirstRep() { - if (getUriErr().isEmpty()) { - return addUriErr(); - } - return getUriErr().get(0); - } - /** - * Adds a new value for uriErr (Uri's with invalid content) - * - *

- * Definition: - * - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Test addUriErr( String theUri) { - if (myUriErr == null) { - myUriErr = new java.util.ArrayList(); - } - myUriErr.add(new UriDt(theUri)); - return this; - } - - - /** - * Gets the value(s) for uriCorr (Uri's with correct content). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getUriCorr() { - if (myUriCorr == null) { - myUriCorr = new java.util.ArrayList(); - } - return myUriCorr; - } - - /** - * Sets the value(s) for uriCorr (Uri's with correct content) - * - *

- * Definition: - * - *

- */ - public Test setUriCorr(java.util.List theValue) { - myUriCorr = theValue; - return this; - } - - /** - * Adds and returns a new value for uriCorr (Uri's with correct content) - * - *

- * Definition: - * - *

- */ - public UriDt addUriCorr() { - UriDt newType = new UriDt(); - getUriCorr().add(newType); - return newType; - } - - /** - * Gets the first repetition for uriCorr (Uri's with correct content), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public UriDt getUriCorrFirstRep() { - if (getUriCorr().isEmpty()) { - return addUriCorr(); - } - return getUriCorr().get(0); - } - /** - * Adds a new value for uriCorr (Uri's with correct content) - * - *

- * Definition: - * - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public Test addUriCorr( String theUri) { - if (myUriCorr == null) { - myUriCorr = new java.util.ArrayList(); - } - myUriCorr.add(new UriDt(theUri)); - return this; - } - - - /** - * Gets the value(s) for idrefSingle (Test idref). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public IdrefDt getIdrefSingle() { - if (myIdrefSingle == null) { - myIdrefSingle = new IdrefDt(); - } - return myIdrefSingle; - } - - /** - * Sets the value(s) for idrefSingle (Test idref) - * - *

- * Definition: - * - *

- */ - public Test setIdrefSingle(IdrefDt theValue) { - myIdrefSingle = theValue; - return this; - } - - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/User.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/User.java deleted file mode 100644 index 95cb7940a4d..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/User.java +++ /dev/null @@ -1,659 +0,0 @@ - - - - - - - - - - - - - - - - -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.List; - -import ca.uhn.fhir.model.api.BaseResource; -import ca.uhn.fhir.model.api.IElement; -import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.api.Include; -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.HumanNameDt; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; -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; -import ca.uhn.fhir.rest.gclient.ReferenceClientParam; -import ca.uhn.fhir.rest.gclient.StringClientParam; -import ca.uhn.fhir.rest.gclient.TokenClientParam; - - -/** - * HAPI/FHIR User Resource - * (A user authorized to use the system) - * - *

- * Definition: - * - *

- * - *

- * Requirements: - * - *

- * - *

- * Profile Definition: - * http://hl7.org/fhir/profiles/User - *

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

- * Description:
- * Type: string
- * Path: User.name
- *

- */ - @SearchParamDefinition(name="name", path="User.name", description="", type="string" ) - public static final String SP_NAME = "name"; - - /** - * Fluent Client search parameter constant for name - *

- * Description:
- * Type: string
- * Path: User.name
- *

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

- * Description:
- * Type: token
- * Path: User.provider
- *

- */ - @SearchParamDefinition(name="provider", path="User.provider", description="", type="token" ) - public static final String SP_PROVIDER = "provider"; - - /** - * Fluent Client search parameter constant for provider - *

- * Description:
- * Type: token
- * Path: User.provider
- *

- */ - public static final TokenClientParam PROVIDER = new TokenClientParam(SP_PROVIDER); - - /** - * Search parameter constant for login - *

- * Description:
- * Type: string
- * Path: User.login
- *

- */ - @SearchParamDefinition(name="login", path="User.login", description="", type="string" ) - public static final String SP_LOGIN = "login"; - - /** - * Fluent Client search parameter constant for login - *

- * Description:
- * Type: string
- * Path: User.login
- *

- */ - public static final StringClientParam LOGIN = new StringClientParam(SP_LOGIN); - - /** - * Search parameter constant for level - *

- * Description:
- * Type: token
- * Path: User.level
- *

- */ - @SearchParamDefinition(name="level", path="User.level", description="", type="token" ) - public static final String SP_LEVEL = "level"; - - /** - * Fluent Client search parameter constant for level - *

- * Description:
- * Type: token
- * Path: User.level
- *

- */ - public static final TokenClientParam LEVEL = new TokenClientParam(SP_LEVEL); - - /** - * Search parameter constant for patient - *

- * Description:
- * Type: reference
- * Path: User.patient
- *

- */ - @SearchParamDefinition(name="patient", path="User.patient", description="", type="reference" ) - public static final String SP_PATIENT = "patient"; - - /** - * Fluent Client search parameter constant for patient - *

- * Description:
- * Type: reference
- * Path: User.patient
- *

- */ - public static final ReferenceClientParam PATIENT = new ReferenceClientParam(SP_PATIENT); - - /** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "User.patient". - */ - public static final Include INCLUDE_PATIENT = new Include("User.patient"); - - - @Child(name="name", type=HumanNameDt.class, order=0, min=0, max=1) - @Description( - shortDefinition="The name of this user", - formalDefinition="" - ) - private HumanNameDt myName; - - @Child(name="provider", type=UriDt.class, order=1, min=0, max=1) - @Description( - shortDefinition="Which system authenticates the user. Blanks = internally authenticated", - formalDefinition="" - ) - private UriDt myProvider; - - @Child(name="login", type=StringDt.class, order=2, min=1, max=1) - @Description( - shortDefinition="The login by which this user is known", - formalDefinition="" - ) - private StringDt myLogin; - - @Child(name="password", type=StringDt.class, order=3, min=0, max=1) - @Description( - shortDefinition="If internal login, the password hash (SHA 256, Hex, lowercase)", - formalDefinition="" - ) - private StringDt myPassword; - - @Child(name="level", type=CodeDt.class, order=4, min=1, max=1) - @Description( - shortDefinition="The level access for this user", - formalDefinition="" - ) - private CodeDt myLevel; - - @Child(name="sessionLength", type=IntegerDt.class, order=5, min=0, max=1) - @Description( - shortDefinition="How long a session lasts for", - formalDefinition="" - ) - private IntegerDt mySessionLength; - - @Child(name="contact", type=ContactDt.class, order=6, min=0, max=Child.MAX_UNLIMITED) - @Description( - shortDefinition="Contact details for the user", - formalDefinition="" - ) - private java.util.List myContact; - - @Child(name="patient", order=7, min=0, max=Child.MAX_UNLIMITED, type={ - ca.uhn.fhir.model.dstu.resource.Patient.class }) - @Description( - shortDefinition="Patient compartments the user has access to (if level is patient/family)", - formalDefinition="" - ) - private java.util.List myPatient; - - - @Override - public boolean isEmpty() { - return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myName, myProvider, myLogin, myPassword, myLevel, mySessionLength, myContact, myPatient); - } - - @Override - public List getAllPopulatedChildElementsOfType(Class theType) { - return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myName, myProvider, myLogin, myPassword, myLevel, mySessionLength, myContact, myPatient); - } - - /** - * Gets the value(s) for name (The name of this user). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public HumanNameDt getName() { - if (myName == null) { - myName = new HumanNameDt(); - } - return myName; - } - - /** - * Sets the value(s) for name (The name of this user) - * - *

- * Definition: - * - *

- */ - public User setName(HumanNameDt theValue) { - myName = theValue; - return this; - } - - - /** - * Gets the value(s) for provider (Which system authenticates the user. Blanks = internally authenticated). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public UriDt getProvider() { - if (myProvider == null) { - myProvider = new UriDt(); - } - return myProvider; - } - - /** - * Sets the value(s) for provider (Which system authenticates the user. Blanks = internally authenticated) - * - *

- * Definition: - * - *

- */ - public User setProvider(UriDt theValue) { - myProvider = theValue; - return this; - } - - /** - * Sets the value for provider (Which system authenticates the user. Blanks = internally authenticated) - * - *

- * Definition: - * - *

- */ - public User setProvider( String theUri) { - myProvider = new UriDt(theUri); - return this; - } - - - /** - * Gets the value(s) for login (The login by which this user is known). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public StringDt getLogin() { - if (myLogin == null) { - myLogin = new StringDt(); - } - return myLogin; - } - - /** - * Sets the value(s) for login (The login by which this user is known) - * - *

- * Definition: - * - *

- */ - public User setLogin(StringDt theValue) { - myLogin = theValue; - return this; - } - - /** - * Sets the value for login (The login by which this user is known) - * - *

- * Definition: - * - *

- */ - public User setLogin( String theString) { - myLogin = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for password (If internal login, the password hash (SHA 256, Hex, lowercase)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public StringDt getPassword() { - if (myPassword == null) { - myPassword = new StringDt(); - } - return myPassword; - } - - /** - * Sets the value(s) for password (If internal login, the password hash (SHA 256, Hex, lowercase)) - * - *

- * Definition: - * - *

- */ - public User setPassword(StringDt theValue) { - myPassword = theValue; - return this; - } - - /** - * Sets the value for password (If internal login, the password hash (SHA 256, Hex, lowercase)) - * - *

- * Definition: - * - *

- */ - public User setPassword( String theString) { - myPassword = new StringDt(theString); - return this; - } - - - /** - * Gets the value(s) for level (The level access for this user). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public CodeDt getLevel() { - if (myLevel == null) { - myLevel = new CodeDt(); - } - return myLevel; - } - - /** - * Sets the value(s) for level (The level access for this user) - * - *

- * Definition: - * - *

- */ - public User setLevel(CodeDt theValue) { - myLevel = theValue; - return this; - } - - /** - * Sets the value for level (The level access for this user) - * - *

- * Definition: - * - *

- */ - public User setLevel( String theCode) { - myLevel = new CodeDt(theCode); - return this; - } - - - /** - * Gets the value(s) for sessionLength (How long a session lasts for). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public IntegerDt getSessionLength() { - if (mySessionLength == null) { - mySessionLength = new IntegerDt(); - } - return mySessionLength; - } - - /** - * Sets the value(s) for sessionLength (How long a session lasts for) - * - *

- * Definition: - * - *

- */ - public User setSessionLength(IntegerDt theValue) { - mySessionLength = theValue; - return this; - } - - /** - * Sets the value for sessionLength (How long a session lasts for) - * - *

- * Definition: - * - *

- */ - public User setSessionLength( int theInteger) { - mySessionLength = new IntegerDt(theInteger); - return this; - } - - - /** - * Gets the value(s) for contact (Contact details for the user). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getContact() { - if (myContact == null) { - myContact = new java.util.ArrayList(); - } - return myContact; - } - - /** - * Sets the value(s) for contact (Contact details for the user) - * - *

- * Definition: - * - *

- */ - public User setContact(java.util.List theValue) { - myContact = theValue; - return this; - } - - /** - * Adds and returns a new value for contact (Contact details for the user) - * - *

- * Definition: - * - *

- */ - public ContactDt addContact() { - ContactDt newType = new ContactDt(); - getContact().add(newType); - return newType; - } - - /** - * Gets the first repetition for contact (Contact details for the user), - * creating it if it does not already exist. - * - *

- * Definition: - * - *

- */ - public ContactDt getContactFirstRep() { - if (getContact().isEmpty()) { - return addContact(); - } - return getContact().get(0); - } - /** - * Adds a new value for contact (Contact details for the user) - * - *

- * Definition: - * - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public User addContact( ContactUseEnum theContactUse, String theValue) { - if (myContact == null) { - myContact = new java.util.ArrayList(); - } - myContact.add(new ContactDt(theContactUse, theValue)); - return this; - } - - /** - * Adds a new value for contact (Contact details for the user) - * - *

- * Definition: - * - *

- * - * @return Returns a reference to this object, to allow for simple chaining. - */ - public User addContact( String theValue) { - if (myContact == null) { - myContact = new java.util.ArrayList(); - } - myContact.add(new ContactDt(theValue)); - return this; - } - - - /** - * Gets the value(s) for patient (Patient compartments the user has access to (if level is patient/family)). - * creating it if it does - * not exist. Will not return null. - * - *

- * Definition: - * - *

- */ - public java.util.List getPatient() { - if (myPatient == null) { - myPatient = new java.util.ArrayList(); - } - return myPatient; - } - - /** - * Sets the value(s) for patient (Patient compartments the user has access to (if level is patient/family)) - * - *

- * Definition: - * - *

- */ - public User setPatient(java.util.List theValue) { - myPatient = theValue; - return this; - } - - /** - * Adds and returns a new value for patient (Patient compartments the user has access to (if level is patient/family)) - * - *

- * Definition: - * - *

- */ - public ResourceReferenceDt addPatient() { - ResourceReferenceDt newType = new ResourceReferenceDt(); - getPatient().add(newType); - return newType; - } - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/TimeDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/TimeDt.java new file mode 100644 index 00000000000..f8092146bba --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/TimeDt.java @@ -0,0 +1,148 @@ +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 org.apache.commons.lang3.StringUtils; + +import ca.uhn.fhir.model.api.BasePrimitive; +import ca.uhn.fhir.model.api.IQueryParameterType; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.api.annotation.SimpleSetter; +import ca.uhn.fhir.parser.DataFormatException; + +/** + * Represents a Time datatype, per the FHIR specification. A time is a specification of hours and minutes (and optionally + * milliseconds), with NO date and NO timezone information attached. It is expressed as a string in the form + * HH:mm:ss[.SSSS] + * + *

+ * This datatype is not valid in FHIR DSTU1 + *

+ * @since FHIR DSTU 2 / HAPI 0.8 + */ +@DatatypeDef(name = "time") +public class TimeDt extends BasePrimitive implements IQueryParameterType { + + private String myValue; + + /** + * Create a new String + */ + public TimeDt() { + super(); + } + + /** + * Create a new String + */ + @SimpleSetter + public TimeDt(@SimpleSetter.Parameter(name = "theString") String theValue) { + myValue = theValue; + } + + @Override + public String getValue() { + return myValue; + } + + public String getValueNotNull() { + return StringUtils.defaultString(myValue); + } + + @Override + public String getValueAsString() { + return myValue; + } + + @Override + public void setValue(String theValue) throws DataFormatException { + myValue = theValue; + } + + @Override + public void setValueAsString(String theValue) throws DataFormatException { + myValue = theValue; + } + + /** + * Returns the value of this string, or null + */ + @Override + public String toString() { + return myValue; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((myValue == null) ? 0 : myValue.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + TimeDt other = (TimeDt) obj; + if (myValue == null) { + if (other.myValue != null) + return false; + } else if (!myValue.equals(other.myValue)) + return false; + return true; + } + + /** + * {@inheritDoc} + */ + @Override + public void setValueAsQueryToken(String theQualifier, String theValue) { + setValue(theValue); + } + + /** + * {@inheritDoc} + */ + @Override + public String getValueAsQueryToken() { + return getValue(); + } + + /** + * Returns true if this datatype has no extensions, and has either a null value or an empty ("") value. + */ + @Override + public boolean isEmpty() { + boolean retVal = super.isBaseEmpty() && StringUtils.isBlank(getValue()); + return retVal; + } + + @Override + public String getQueryParameterQualifier() { + return null; + } + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/narrative/DefaultThymeleafNarrativeGenerator.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/narrative/DefaultThymeleafNarrativeGenerator.java index b5590fec6d3..fe28af8d386 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/narrative/DefaultThymeleafNarrativeGenerator.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/narrative/DefaultThymeleafNarrativeGenerator.java @@ -23,7 +23,6 @@ package ca.uhn.fhir.narrative; import java.util.ArrayList; import java.util.List; -import ca.uhn.fhir.model.dstu.resource.Conformance; import ca.uhn.fhir.rest.server.RestfulServer; @@ -46,7 +45,7 @@ public class DefaultThymeleafNarrativeGenerator extends BaseThymeleafNarrativeGe /** * If set to true (default is false) a special custom narrative for the - * {@link Conformance} resource will be provided, which is designed to be used with + * {@link ca.uhn.fhir.model.dstu.resource.Conformance} resource will be provided, which is designed to be used with * HAPI {@link RestfulServer} instances. This narrative provides a friendly search * page which can assist users of the service. */ @@ -56,7 +55,7 @@ public class DefaultThymeleafNarrativeGenerator extends BaseThymeleafNarrativeGe /** * If set to true (default is false) a special custom narrative for the - * {@link Conformance} resource will be provided, which is designed to be used with + * {@link ca.uhn.fhir.model.dstu.resource.Conformance} resource will be provided, which is designed to be used with * HAPI {@link RestfulServer} instances. This narrative provides a friendly search * page which can assist users of the service. */ diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/ParserState.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/ParserState.java index f3ee6eb660a..5144e5833fb 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/ParserState.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/ParserState.java @@ -1495,6 +1495,11 @@ class ParserState { } } + @Override + public void enteringNewElementExtension(StartElement theElement, String theUrlAttr, boolean theIsModifier) { + myDepth++; + } + @Override public void enteringNewElement(String theNamespaceURI, String theLocalPart) throws DataFormatException { myDepth++; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/annotation/History.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/annotation/History.java index 225f85f8bed..7c87d0adc7e 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/annotation/History.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/annotation/History.java @@ -26,8 +26,8 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.dstu.resource.Patient; import ca.uhn.fhir.model.primitive.IdDt; +//import ca.uhn.fhir.testmodel.Patient; // TODO: qualify this correctly /** * RESTful method annotation to be used for the FHIR diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/annotation/OptionalParam.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/annotation/OptionalParam.java index 5468be2aa04..902dcd218ea 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/annotation/OptionalParam.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/annotation/OptionalParam.java @@ -25,10 +25,9 @@ import java.lang.annotation.RetentionPolicy; import ca.uhn.fhir.model.api.IQueryParameterType; import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.dstu.resource.Observation; -import ca.uhn.fhir.model.dstu.resource.Patient; import ca.uhn.fhir.rest.param.CompositeParam; import ca.uhn.fhir.rest.param.ReferenceParam; +//import ca.uhn.fhir.testmodel.Patient; // TODO: qualify this correctly /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/annotation/RequiredParam.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/annotation/RequiredParam.java index 444c35f2bc8..54c1ce8c95d 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/annotation/RequiredParam.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/annotation/RequiredParam.java @@ -25,10 +25,9 @@ import java.lang.annotation.RetentionPolicy; import ca.uhn.fhir.model.api.IQueryParameterType; import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.dstu.resource.Observation; -import ca.uhn.fhir.model.dstu.resource.Patient; import ca.uhn.fhir.rest.param.CompositeParam; import ca.uhn.fhir.rest.param.ReferenceParam; +//import ca.uhn.fhir.testmodel.Patient; // TODO: qualify this correctly @Retention(RetentionPolicy.RUNTIME) /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/MethodOutcome.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/MethodOutcome.java index ff106e411e5..a4a538e23b0 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/MethodOutcome.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/MethodOutcome.java @@ -20,13 +20,13 @@ package ca.uhn.fhir.rest.api; * #L% */ -import ca.uhn.fhir.model.dstu.resource.OperationOutcome; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; import ca.uhn.fhir.model.primitive.IdDt; public class MethodOutcome { private IdDt myId; - private OperationOutcome myOperationOutcome; + private BaseOperationOutcome myOperationOutcome; private IdDt myVersionId; private Boolean myCreated; @@ -67,12 +67,12 @@ public class MethodOutcome { * @param theId * The ID of the created/updated resource * - * @param theOperationOutcome + * @param theBaseOperationOutcome * The operation outcome to return with the response (or null for none) */ - public MethodOutcome(IdDt theId, OperationOutcome theOperationOutcome) { + public MethodOutcome(IdDt theId, BaseOperationOutcome theBaseOperationOutcome) { myId = theId; - myOperationOutcome = theOperationOutcome; + myOperationOutcome = theBaseOperationOutcome; } /** @@ -81,16 +81,16 @@ public class MethodOutcome { * @param theId * The ID of the created/updated resource * - * @param theOperationOutcome + * @param theBaseOperationOutcome * The operation outcome to return with the response (or null for none) * * @param theCreated * If not null, indicates whether the resource was created (as opposed to being updated). This is generally not needed, since the server can assume based on the method being called * whether the result was a creation or an update. However, it can be useful if you are implementing an update method that does a create if the ID doesn't already exist. */ - public MethodOutcome(IdDt theId, OperationOutcome theOperationOutcome, Boolean theCreated) { + public MethodOutcome(IdDt theId, BaseOperationOutcome theBaseOperationOutcome, Boolean theCreated) { myId = theId; - myOperationOutcome = theOperationOutcome; + myOperationOutcome = theBaseOperationOutcome; myCreated = theCreated; } @@ -105,10 +105,10 @@ public class MethodOutcome { /** * @deprecated Use the constructor which accepts a single IdDt parameter, and include the logical ID and version ID in that IdDt instance */ - public MethodOutcome(IdDt theId, IdDt theVersionId, OperationOutcome theOperationOutcome) { + public MethodOutcome(IdDt theId, IdDt theVersionId, BaseOperationOutcome theBaseOperationOutcome) { myId = theId; myVersionId = theVersionId; - myOperationOutcome = theOperationOutcome; + myOperationOutcome = theBaseOperationOutcome; } public IdDt getId() { @@ -116,11 +116,11 @@ public class MethodOutcome { } /** - * Returns the {@link OperationOutcome} resource to return to the client or null if none. + * Returns the {@link BaseOperationOutcome} resource to return to the client or null if none. * * @return This method will return null, unlike many methods in the API. */ - public OperationOutcome getOperationOutcome() { + public BaseOperationOutcome getOperationOutcome() { return myOperationOutcome; } @@ -156,10 +156,10 @@ public class MethodOutcome { } /** - * Sets the {@link OperationOutcome} resource to return to the client. Set to null (which is the default) if none. + * Sets the {@link BaseOperationOutcome} resource to return to the client. Set to null (which is the default) if none. */ - public void setOperationOutcome(OperationOutcome theOperationOutcome) { - myOperationOutcome = theOperationOutcome; + public void setOperationOutcome(BaseOperationOutcome theBaseOperationOutcome) { + myOperationOutcome = theBaseOperationOutcome; } /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/BaseClient.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/BaseClient.java index f176b48317a..bed3fbad96d 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/BaseClient.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/BaseClient.java @@ -47,7 +47,7 @@ import org.apache.http.client.methods.HttpRequestBase; import org.apache.http.entity.ContentType; import ca.uhn.fhir.context.FhirContext; -import ca.uhn.fhir.model.dstu.resource.OperationOutcome; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; import ca.uhn.fhir.parser.DataFormatException; import ca.uhn.fhir.parser.IParser; import ca.uhn.fhir.rest.client.exceptions.FhirClientConnectionException; @@ -211,7 +211,7 @@ public abstract class BaseClient { } String message = "HTTP " + response.getStatusLine().getStatusCode() + " " + response.getStatusLine().getReasonPhrase(); - OperationOutcome oo=null; + BaseOperationOutcome oo=null; if (Constants.CT_TEXT.equals(mimeType)) { message = message + ": " + body; } else { @@ -219,9 +219,10 @@ public abstract class BaseClient { if (enc != null) { IParser p = enc.newParser(theContext); try { - oo = p.parseResource(OperationOutcome.class, body); - if (oo.getIssueFirstRep().getDetails().isEmpty()==false) { - message = message + ": " + oo.getIssueFirstRep().getDetails().getValue(); + // TODO: handle if something other than OO comes back + oo = (BaseOperationOutcome) p.parseResource( body); + if (oo.getIssueFirstRep().getDetailsElement().isEmpty()==false) { + message = message + ": " + oo.getIssueFirstRep().getDetailsElement().getValue(); } } catch (Exception e) { ourLog.debug("Failed to process OperationOutcome response"); diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/GenericClient.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/GenericClient.java index ebebff09037..8c1c97e9fe0 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/GenericClient.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/GenericClient.java @@ -44,8 +44,8 @@ import ca.uhn.fhir.model.api.IQueryParameterType; import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.api.Include; import ca.uhn.fhir.model.api.TagList; -import ca.uhn.fhir.model.dstu.resource.Conformance; -import ca.uhn.fhir.model.dstu.resource.OperationOutcome; +import ca.uhn.fhir.model.base.resource.BaseConformance; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; import ca.uhn.fhir.model.primitive.DateTimeDt; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.model.primitive.UriDt; @@ -115,14 +115,17 @@ public class GenericClient extends BaseClient implements IGenericClient { } @Override - public Conformance conformance() { + public BaseConformance conformance() { HttpGetClientInvocation invocation = MethodUtil.createConformanceInvocation(); if (isKeepResponses()) { myLastRequest = invocation.asHttpRequest(getServerBase(), createExtraParams(), getEncoding()); } - ResourceResponseHandler binding = new ResourceResponseHandler(Conformance.class, null); - Conformance resp = invokeClient(myContext, binding, invocation, myLogRequestAndResponse); + @SuppressWarnings("unchecked") + Class conformance = (Class) myContext.getResourceDefinition("Conformance").getImplementingClass(); + + ResourceResponseHandler binding = new ResourceResponseHandler(conformance, null); + BaseConformance resp = invokeClient(myContext, binding, invocation, myLogRequestAndResponse); return resp; } @@ -608,12 +611,12 @@ public class GenericClient extends BaseClient implements IGenericClient { } - private class DeleteInternal extends BaseClientExecutable implements IDelete, IDeleteTyped { + private class DeleteInternal extends BaseClientExecutable implements IDelete, IDeleteTyped { private IdDt myId; @Override - public OperationOutcome execute() { + public BaseOperationOutcome execute() { HttpDeleteClientInvocation invocation = DeleteMethodBinding.createDeleteInvocation(myId); OperationOutcomeResponseHandler binding = new OperationOutcomeResponseHandler(); Map> params = new HashMap>(); @@ -763,19 +766,20 @@ public class GenericClient extends BaseClient implements IGenericClient { } - private final class OperationOutcomeResponseHandler implements IClientResponseHandler { + private final class OperationOutcomeResponseHandler implements IClientResponseHandler { @Override - public OperationOutcome invokeClient(String theResponseMimeType, Reader theResponseReader, int theResponseStatusCode, Map> theHeaders) throws IOException, + public BaseOperationOutcome invokeClient(String theResponseMimeType, Reader theResponseReader, int theResponseStatusCode, Map> theHeaders) throws IOException, BaseServerResponseException { EncodingEnum respType = EncodingEnum.forContentType(theResponseMimeType); if (respType == null) { return null; } IParser parser = respType.newParser(myContext); - OperationOutcome retVal; + BaseOperationOutcome retVal; try { - retVal = parser.parseResource(OperationOutcome.class, theResponseReader); + // TODO: handle if something else than OO comes back + retVal = (BaseOperationOutcome) parser.parseResource(theResponseReader); } catch (DataFormatException e) { ourLog.warn("Failed to parse OperationOutcome response", e); return null; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/IGenericClient.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/IGenericClient.java index 82d113fb74c..e2d10f90a90 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/IGenericClient.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/IGenericClient.java @@ -26,7 +26,7 @@ import java.util.Map; import ca.uhn.fhir.model.api.Bundle; import ca.uhn.fhir.model.api.IQueryParameterType; import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.dstu.resource.Conformance; +import ca.uhn.fhir.model.base.resource.BaseConformance; import ca.uhn.fhir.model.primitive.DateTimeDt; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.model.primitive.UriDt; @@ -41,10 +41,11 @@ import ca.uhn.fhir.rest.gclient.IUntypedQuery; import ca.uhn.fhir.rest.gclient.IUpdate; public interface IGenericClient { + /** * Retrieves and returns the server conformance statement */ - Conformance conformance(); + BaseConformance conformance(); /** * Fluent method for the "create" operation, which creates a new resource instance on the server diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/api/IBasicClient.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/api/IBasicClient.java index de479696bd7..289fcca41ed 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/api/IBasicClient.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/api/IBasicClient.java @@ -20,7 +20,7 @@ package ca.uhn.fhir.rest.client.api; * #L% */ -import ca.uhn.fhir.model.dstu.resource.Conformance; +import ca.uhn.fhir.model.base.resource.BaseConformance; import ca.uhn.fhir.rest.annotation.Metadata; /** @@ -35,6 +35,6 @@ public interface IBasicClient extends IRestfulClient { * @see See the FHIR HTTP Conformance definition */ @Metadata - Conformance getServerConformanceStatement(); + BaseConformance getServerConformanceStatement(); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/gclient/IDeleteTyped.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/gclient/IDeleteTyped.java index cb8c5da121a..6f6649153fc 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/gclient/IDeleteTyped.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/gclient/IDeleteTyped.java @@ -20,9 +20,9 @@ package ca.uhn.fhir.rest.gclient; * #L% */ -import ca.uhn.fhir.model.dstu.resource.OperationOutcome; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; -public interface IDeleteTyped extends IClientExecutable { +public interface IDeleteTyped extends IClientExecutable { // nothing for now diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/gclient/TokenClientParam.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/gclient/TokenClientParam.java index 3bc04441f80..0fecefdf538 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/gclient/TokenClientParam.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/gclient/TokenClientParam.java @@ -1,11 +1,11 @@ package ca.uhn.fhir.rest.gclient; -import static org.apache.commons.lang3.StringUtils.*; +import static org.apache.commons.lang3.StringUtils.defaultString; import java.util.Arrays; import java.util.List; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; +import ca.uhn.fhir.model.base.composite.BaseIdentifierDt; /* * #%L @@ -67,17 +67,17 @@ public class TokenClientParam implements IParam { } @Override - public ICriterion identifier(IdentifierDt theIdentifier) { - return new TokenCriterion(getParamName(), theIdentifier.getSystem().getValueAsString(), theIdentifier.getValue().getValue()); + public ICriterion identifier(BaseIdentifierDt theIdentifier) { + return new TokenCriterion(getParamName(), theIdentifier.getSystemElement().getValueAsString(), theIdentifier.getValueElement().getValue()); } @Override - public ICriterion identifiers(List theIdentifiers) { + public ICriterion identifiers(List theIdentifiers) { return new TokenCriterion(getParamName(), theIdentifiers); } @Override - public ICriterion identifiers(IdentifierDt... theIdentifiers) { + public ICriterion identifiers(BaseIdentifierDt... theIdentifiers) { return new TokenCriterion(getParamName(), Arrays.asList(theIdentifiers)); } }; @@ -131,7 +131,7 @@ public class TokenClientParam implements IParam { * The identifier * @return A criterion */ - ICriterion identifier(IdentifierDt theIdentifier); + ICriterion identifier(BaseIdentifierDt theIdentifier); /** * Creates a search criterion that matches against the given collection of identifiers (system and code if both are present, or whatever is present). @@ -141,7 +141,7 @@ public class TokenClientParam implements IParam { * The identifier * @return A criterion */ - ICriterion identifiers(List theIdentifiers); + ICriterion identifiers(List theIdentifiers); /** * Creates a search criterion that matches against the given collection of identifiers (system and code if both are present, or whatever is present). @@ -151,7 +151,7 @@ public class TokenClientParam implements IParam { * The identifier * @return A criterion */ - ICriterion identifiers(IdentifierDt... theIdentifiers); + ICriterion identifiers(BaseIdentifierDt... theIdentifiers); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/gclient/TokenCriterion.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/gclient/TokenCriterion.java index 9981148aeed..372b7d0894f 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/gclient/TokenCriterion.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/gclient/TokenCriterion.java @@ -24,7 +24,7 @@ import java.util.List; import org.apache.commons.lang3.StringUtils; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; +import ca.uhn.fhir.model.base.composite.BaseIdentifierDt; import ca.uhn.fhir.rest.param.ParameterUtil; class TokenCriterion implements ICriterion, ICriterionInternal { @@ -51,17 +51,17 @@ class TokenCriterion implements ICriterion, ICriterionInternal return value; } - public TokenCriterion(String theParamName, List theValue) { + public TokenCriterion(String theParamName, List theValue) { myName=theParamName; StringBuilder b = new StringBuilder(); - for (IdentifierDt next : theValue) { - if (next.getSystem().isEmpty() && next.getValue().isEmpty()) { + for (BaseIdentifierDt next : theValue) { + if (next.getSystemElement().isEmpty() && next.getValueElement().isEmpty()) { continue; } if (b.length() > 0) { b.append(','); } - b.append(toValue(next.getSystem().getValueAsString(), next.getValue().getValue())); + b.append(toValue(next.getSystemElement().getValueAsString(), next.getValueElement().getValue())); } myValue = b.toString(); } 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 65a513af42c..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 @@ -40,7 +40,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.TagList; -import ca.uhn.fhir.model.dstu.resource.OperationOutcome; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; import ca.uhn.fhir.model.dstu.valueset.RestfulOperationSystemEnum; import ca.uhn.fhir.model.dstu.valueset.RestfulOperationTypeEnum; import ca.uhn.fhir.parser.IParser; @@ -230,7 +230,8 @@ public abstract class BaseMethodBinding implements IClientResponseHandler break; case Constants.STATUS_HTTP_422_UNPROCESSABLE_ENTITY: IParser parser = createAppropriateParserForParsingResponse(theResponseMimeType, theResponseReader, theStatusCode); - OperationOutcome operationOutcome = parser.parseResource(OperationOutcome.class, theResponseReader); + // TODO: handle if something other than OO comes back + BaseOperationOutcome operationOutcome = (BaseOperationOutcome) parser.parseResource(theResponseReader); ex = new UnprocessableEntityException(operationOutcome); break; default: @@ -447,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/BaseOutcomeReturningMethodBinding.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseOutcomeReturningMethodBinding.java index 69beff95087..9dc0300202d 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseOutcomeReturningMethodBinding.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseOutcomeReturningMethodBinding.java @@ -38,7 +38,7 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum; import ca.uhn.fhir.model.api.TagList; -import ca.uhn.fhir.model.dstu.resource.OperationOutcome; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.parser.IParser; import ca.uhn.fhir.rest.api.MethodOutcome; @@ -146,7 +146,7 @@ abstract class BaseOutcomeReturningMethodBinding extends BaseMethodBinding= 0; i--) { IServerInterceptor next = theServer.getInterceptors().get(i); boolean continueProcessing = next.outgoingResponse(theRequest, outcome, theRequest.getServletRequest(), theRequest.getServletResponse()); 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 d15d3e49a67..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; @@ -73,7 +74,8 @@ abstract class BaseResourceReturningMethodBinding extends BaseMethodBinding myResourceType; - public BaseResourceReturningMethodBinding(Class theReturnResourceType, Method theMethod, FhirContext theConetxt, Object theProvider) { + @SuppressWarnings("unchecked") + public BaseResourceReturningMethodBinding(Class theReturnResourceType, Method theMethod, FhirContext theConetxt, Object theProvider) { super(theMethod, theConetxt, theProvider); Class methodReturnType = theMethod.getReturnType(); @@ -100,12 +102,17 @@ abstract class BaseResourceReturningMethodBinding extends BaseMethodBinding) 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 d5e449ed5a1..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 @@ -21,11 +21,12 @@ package ca.uhn.fhir.rest.method; */ import java.lang.reflect.Method; +import java.lang.reflect.Modifier; import ca.uhn.fhir.context.ConfigurationException; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.dstu.resource.Conformance; +import ca.uhn.fhir.model.base.resource.BaseConformance; import ca.uhn.fhir.model.dstu.valueset.RestfulOperationSystemEnum; import ca.uhn.fhir.model.dstu.valueset.RestfulOperationTypeEnum; import ca.uhn.fhir.rest.method.SearchMethodBinding.RequestType; @@ -37,10 +38,13 @@ import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; public class ConformanceMethodBinding extends BaseResourceReturningMethodBinding { public ConformanceMethodBinding(Method theMethod, FhirContext theContext, Object theProvider) { - super(Conformance.class, theMethod, theContext, theProvider); + super(theMethod.getReturnType(), theMethod, theContext, theProvider); - if (getMethodReturnType() != MethodReturnTypeEnum.RESOURCE || theMethod.getReturnType() != Conformance.class) { - throw new ConfigurationException("Conformance resource provider method '" + theMethod.getName() + "' should return type " + Conformance.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/method/MethodUtil.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/MethodUtil.java index e05f7818b75..f665be603c2 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/MethodUtil.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/MethodUtil.java @@ -1,6 +1,7 @@ package ca.uhn.fhir.rest.method; -import static org.apache.commons.lang3.StringUtils.*; +import static org.apache.commons.lang3.StringUtils.isBlank; +import static org.apache.commons.lang3.StringUtils.isNotBlank; import java.io.IOException; import java.io.PushbackReader; @@ -34,7 +35,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.Description; -import ca.uhn.fhir.model.dstu.resource.OperationOutcome; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.model.primitive.InstantDt; import ca.uhn.fhir.parser.IParser; @@ -303,8 +304,8 @@ public class MethodUtil { if (reader != null) { IParser parser = ct.newParser(theContext); IResource outcome = parser.parseResource(reader); - if (outcome instanceof OperationOutcome) { - retVal.setOperationOutcome((OperationOutcome) outcome); + if (outcome instanceof BaseOperationOutcome) { + retVal.setOperationOutcome((BaseOperationOutcome) outcome); } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/SearchParameter.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/SearchParameter.java index 448b8d1cd9e..6d0626703ed 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/SearchParameter.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/SearchParameter.java @@ -37,13 +37,12 @@ import ca.uhn.fhir.model.api.IQueryParameterAnd; import ca.uhn.fhir.model.api.IQueryParameterOr; import ca.uhn.fhir.model.api.IQueryParameterType; import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; +import ca.uhn.fhir.model.base.composite.BaseIdentifierDt; +import ca.uhn.fhir.model.base.composite.BaseQuantityDt; import ca.uhn.fhir.model.dstu.valueset.SearchParamTypeEnum; import ca.uhn.fhir.model.primitive.StringDt; import ca.uhn.fhir.rest.annotation.OptionalParam; import ca.uhn.fhir.rest.param.BaseQueryParameter; -import ca.uhn.fhir.rest.param.CodingListParam; import ca.uhn.fhir.rest.param.CompositeAndListParam; import ca.uhn.fhir.rest.param.CompositeOrListParam; import ca.uhn.fhir.rest.param.CompositeParam; @@ -51,7 +50,6 @@ import ca.uhn.fhir.rest.param.DateAndListParam; import ca.uhn.fhir.rest.param.DateOrListParam; import ca.uhn.fhir.rest.param.DateParam; import ca.uhn.fhir.rest.param.DateRangeParam; -import ca.uhn.fhir.rest.param.IdentifierListParam; import ca.uhn.fhir.rest.param.NumberAndListParam; import ca.uhn.fhir.rest.param.NumberOrListParam; import ca.uhn.fhir.rest.param.NumberParam; @@ -306,16 +304,12 @@ public class SearchParameter extends BaseQueryParameter { myParamType = SearchParamTypeEnum.STRING; } else if (QualifiedDateParam.class.isAssignableFrom(type)) { myParamType = SearchParamTypeEnum.DATE; - } else if (CodingListParam.class.isAssignableFrom(type)) { + } else if (BaseIdentifierDt.class.isAssignableFrom(type)) { myParamType = SearchParamTypeEnum.TOKEN; - } else if (IdentifierDt.class.isAssignableFrom(type)) { - myParamType = SearchParamTypeEnum.TOKEN; - } else if (QuantityDt.class.isAssignableFrom(type)) { + } else if (BaseQuantityDt.class.isAssignableFrom(type)) { myParamType = SearchParamTypeEnum.QUANTITY; } else if (ReferenceParam.class.isAssignableFrom(type)) { myParamType = SearchParamTypeEnum.REFERENCE; - } else if (IdentifierListParam.class.isAssignableFrom(type)) { - myParamType = SearchParamTypeEnum.TOKEN; } else { throw new ConfigurationException("Unknown search parameter type: " + type); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/TransactionMethodBinding.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/TransactionMethodBinding.java index ecf8cade8a8..677660b2178 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/TransactionMethodBinding.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/TransactionMethodBinding.java @@ -20,7 +20,7 @@ package ca.uhn.fhir.rest.method; * #L% */ -import static org.apache.commons.lang3.StringUtils.*; +import static org.apache.commons.lang3.StringUtils.isNotBlank; import java.io.IOException; import java.lang.reflect.Method; @@ -32,7 +32,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.dstu.resource.OperationOutcome; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; import ca.uhn.fhir.model.dstu.valueset.RestfulOperationSystemEnum; import ca.uhn.fhir.model.dstu.valueset.RestfulOperationTypeEnum; import ca.uhn.fhir.model.primitive.IdDt; @@ -127,7 +127,7 @@ public class TransactionMethodBinding extends BaseResourceReturningMethodBinding IdDt oldId = oldIds.get(retResources.get(i)); IResource newRes = retResources.get(i); if (newRes.getId() == null || newRes.getId().isEmpty()) { - if (!(newRes instanceof OperationOutcome)) { + if (!(newRes instanceof BaseOperationOutcome)) { throw new InternalErrorException("Transaction method returned resource at index " + i + " with no id specified - IResource#setId(IdDt)"); } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/CodingListParam.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/CodingListParam.java deleted file mode 100644 index 5191f3e8fcb..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/CodingListParam.java +++ /dev/null @@ -1,138 +0,0 @@ -package ca.uhn.fhir.rest.param; - -/* - * #%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.Collection; -import java.util.Iterator; -import java.util.List; - -import ca.uhn.fhir.model.api.IQueryParameterOr; -import ca.uhn.fhir.model.api.IQueryParameterType; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.rest.method.QualifiedParamList; - -/** - * @deprecated Use {@link TokenOrListParam} instead - */ -public class CodingListParam implements IQueryParameterOr, Iterable { - - private List myCodings = new ArrayList(); - - /** - * Constructor. Codings should be added, e.g. using {@link #add(CodingDt)} - */ - public CodingListParam() { - // nothing - } - - /** - * Constructor which accepts an array of codings - * - * @param theCodings - * The codings - */ - public CodingListParam(CodingDt... theCodings) { - if (theCodings != null) { - for (CodingDt next : theCodings) { - add(next); - } - } - } - - /** - * Constructor which accepts a code system and an array of codes in that system - * - * @param theSystem - * The code system - * @param theCodings - * The codes - */ - public CodingListParam(String theSystem, String... theCodes) { - if (theCodes != null) { - for (String next : theCodes) { - add(new CodingDt(theSystem, next)); - } - } - } - - /** - * Constructor which accepts a code system and a collection of codes in that system - * - * @param theSystem - * The code system - * @param theCodings - * The codes - */ - public CodingListParam(String theSystem, Collection theCodes) { - if (theCodes != null) { - for (String next : theCodes) { - add(new CodingDt(theSystem, next)); - } - } - } - - /** - * Returns all Codings associated with this list - */ - public List getCodings() { - if (myCodings == null) { - myCodings = new ArrayList(); - } - return myCodings; - } - - @Override - public List getValuesAsQueryTokens() { - ArrayList retVal = new ArrayList(); - for (CodingDt next : myCodings) { - retVal.add(next); - } - return retVal; - } - - /** - * Returns all Codings associated with this list - */ - public void setCodings(List theCodings) { - myCodings = theCodings; - } - - @Override - public void setValuesAsQueryTokens(QualifiedParamList theParameters) { - getCodings().clear(); - for (String string : theParameters) { - CodingDt dt = new CodingDt(); - dt.setValueAsQueryToken(null, string); - myCodings.add(dt); - } - } - - public void add(CodingDt theCodingDt) { - myCodings.add(theCodingDt); - } - - @Override - public Iterator iterator() { - return getCodings().iterator(); - } - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/IdentifierListParam.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/IdentifierListParam.java deleted file mode 100644 index a12648e940b..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/IdentifierListParam.java +++ /dev/null @@ -1,76 +0,0 @@ -package ca.uhn.fhir.rest.param; - -/* - * #%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.IQueryParameterOr; -import ca.uhn.fhir.model.api.IQueryParameterType; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.rest.method.QualifiedParamList; - -/** - * @deprecated Use {@link TokenOrListParam} instead. That class provides similar functionality but is named to be consistent with other types - */ -public class IdentifierListParam implements IQueryParameterOr { - - private List myIdentifiers = new ArrayList(); - - /** - * Returns all identifiers associated with this list - */ - public List getIdentifiers() { - return myIdentifiers; - } - - @Override - public List getValuesAsQueryTokens() { - ArrayList retVal = new ArrayList(); - for (IdentifierDt next : myIdentifiers) { - retVal.add(next); - } - return retVal; - } - - /** - * Returns all identifiers associated with this list - */ - public void setIdentifiers(List theIdentifiers) { - myIdentifiers = theIdentifiers; - } - - @Override - public void setValuesAsQueryTokens(QualifiedParamList theParameters) { - for (String string : theParameters) { - IdentifierDt dt = new IdentifierDt(); - dt.setValueAsQueryToken(null, string); - myIdentifiers.add(dt); - } - } - - public void addIdentifier(IdentifierDt theIdentifierDt) { - if (theIdentifierDt != null && theIdentifierDt.isEmpty() == false) { - getIdentifiers().add(theIdentifierDt); - } - } - -} 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 new file mode 100644 index 00000000000..dfcfbc8b4f0 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/InternalCodingDt.java @@ -0,0 +1,367 @@ + + + + + + + + + + + + + + + + +package ca.uhn.fhir.rest.param; + +/* + * #%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.Description; +import ca.uhn.fhir.model.base.composite.BaseCodingDt; +import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; +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; + +public class InternalCodingDt + extends BaseCodingDt implements ICompositeDatatype +{ + + /** + * Constructor + */ + public InternalCodingDt() { + super(); + } + + /** + * Creates a new Coding with the given system and code + */ + public InternalCodingDt(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; + + + + @Override + public boolean isEmpty() { + return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySystem, myVersion, myCode, myDisplay, myPrimary); + } + + @Override + public List getAllPopulatedChildElementsOfType(Class theType) { + return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySystem, myVersion, myCode, myDisplay, myPrimary); + } + + /** + * 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 getSystemElement() { + 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 InternalCodingDt 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 InternalCodingDt 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 InternalCodingDt 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 InternalCodingDt 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 getCodeElement() { + 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 InternalCodingDt 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 InternalCodingDt 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 InternalCodingDt 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 InternalCodingDt 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 InternalCodingDt 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 InternalCodingDt 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() { + throw new UnsupportedOperationException(); + } + + /** + * 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 InternalCodingDt setValueSet(ResourceReferenceDt theValue) { + throw new UnsupportedOperationException(); + } + + + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/InternalQuantityDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/InternalQuantityDt.java new file mode 100644 index 00000000000..3e275c864ef --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/InternalQuantityDt.java @@ -0,0 +1,420 @@ + + + + + + + + + + + + + + + + +package ca.uhn.fhir.rest.param; + +/* + * #%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.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; + +class InternalQuantityDt + extends BaseQuantityDt implements ICompositeDatatype +{ + + /** + * Constructor + */ + public InternalQuantityDt() { + // nothing + } + + /** + * Constructor + */ + @SimpleSetter + public InternalQuantityDt(@SimpleSetter.Parameter(name="theValue") double theValue) { + setValue(theValue); + } + + /** + * Constructor + */ + @SimpleSetter + public InternalQuantityDt(@SimpleSetter.Parameter(name="theValue") long theValue) { + setValue(theValue); + } + + /** + * Constructor + */ + @SimpleSetter + public InternalQuantityDt(@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 InternalQuantityDt(@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 InternalQuantityDt(@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 InternalQuantityDt(@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 getValueElement() { + 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 InternalQuantityDt 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 InternalQuantityDt 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 InternalQuantityDt 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 InternalQuantityDt 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 getComparatorElement() { + 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 InternalQuantityDt 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 InternalQuantityDt setComparator(QuantityCompararatorEnum theValue) { + getComparatorElement().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 getUnitsElement() { + 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 InternalQuantityDt setUnits(StringDt theValue) { + myUnits = theValue; + return this; + } + + /** + * Sets the value for units (Unit representation) + * + *

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

+ */ + public InternalQuantityDt 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 getSystemElement() { + 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 InternalQuantityDt 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 InternalQuantityDt 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 getCodeElement() { + 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 InternalQuantityDt 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 InternalQuantityDt setCode( String theCode) { + myCode = new CodeDt(theCode); + return this; + } + + + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/NumberParam.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/NumberParam.java index 000fa6753eb..74de27fe692 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/NumberParam.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/NumberParam.java @@ -20,17 +20,16 @@ package ca.uhn.fhir.rest.param; * #L% */ -import static org.apache.commons.lang3.StringUtils.*; +import static org.apache.commons.lang3.StringUtils.isBlank; import java.math.BigDecimal; import ca.uhn.fhir.model.api.IQueryParameterType; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; public class NumberParam extends BaseParam implements IQueryParameterType { - private QuantityDt myQuantity = new QuantityDt(); + private InternalQuantityDt myQuantity = new InternalQuantityDt(); public NumberParam() { } @@ -50,22 +49,22 @@ public class NumberParam extends BaseParam implements IQueryParameterType { StringBuilder b = new StringBuilder(); b.append(getClass().getSimpleName()); b.append("["); - if (myQuantity.getComparator().isEmpty() == false) { - b.append(myQuantity.getComparator().getValue()); + if (myQuantity.getComparatorElement().isEmpty() == false) { + b.append(myQuantity.getComparatorElement().getValue()); } - if (myQuantity.getValue().isEmpty() == false) { - b.append(myQuantity.getValue().toString()); + if (myQuantity.getValueElement().isEmpty() == false) { + b.append(myQuantity.getValueElement().toString()); } b.append("]"); return b.toString(); } public QuantityCompararatorEnum getComparator() { - return myQuantity.getComparator().getValueAsEnum(); + return myQuantity.getComparatorElement().getValueAsEnum(); } public BigDecimal getValue() { - return myQuantity.getValue().getValue(); + return myQuantity.getValueElement().getValue(); } @@ -100,11 +99,11 @@ public class NumberParam extends BaseParam implements IQueryParameterType { } StringBuilder b = new StringBuilder(); - if (myQuantity.getComparator().isEmpty() == false) { - b.append(myQuantity.getComparator().getValue()); + if (myQuantity.getComparatorElement().isEmpty() == false) { + b.append(myQuantity.getComparatorElement().getValue()); } - if (myQuantity.getValue().isEmpty() == false) { - b.append(myQuantity.getValue().toString()); + if (myQuantity.getValueElement().isEmpty() == false) { + b.append(myQuantity.getValueElement().toString()); } return b.toString(); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/ParameterUtil.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/ParameterUtil.java index a8e5b4f3e6d..54f68aded1c 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/ParameterUtil.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/ParameterUtil.java @@ -179,8 +179,20 @@ public class ParameterUtil { } /** - * Escapes a string according to the rules for parameter escaping specified in the FHIR Specification Escaping Section + * Escapes a string according to the rules for parameter escaping specified in the FHIR Specification Escaping + * Section + */ + public static String escapeWithDefault(Object theValue) { + if (theValue == null) { + return ""; + } else { + return escape(theValue.toString()); + } + } + + /** + * Escapes a string according to the rules for parameter escaping specified in the FHIR Specification Escaping + * Section */ public static String escape(String theValue) { if (theValue == null) { @@ -205,8 +217,8 @@ public class ParameterUtil { } /** - * Unescapes a string according to the rules for parameter escaping specified in the FHIR Specification Escaping Section + * Unescapes a string according to the rules for parameter escaping specified in the FHIR Specification Escaping + * Section */ public static String unescape(String theValue) { if (theValue == null) { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/QuantityParam.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/QuantityParam.java index a581b6144ae..409e3d8d3ac 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/QuantityParam.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/QuantityParam.java @@ -20,8 +20,8 @@ package ca.uhn.fhir.rest.param; * #L% */ -import static ca.uhn.fhir.rest.param.ParameterUtil.*; -import static org.apache.commons.lang3.StringUtils.*; +import static ca.uhn.fhir.rest.param.ParameterUtil.escape; +import static org.apache.commons.lang3.StringUtils.defaultString; import java.math.BigDecimal; import java.util.List; @@ -31,7 +31,6 @@ import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import ca.uhn.fhir.model.api.IQueryParameterType; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.CodeDt; @@ -42,7 +41,7 @@ import ca.uhn.fhir.model.primitive.UriDt; public class QuantityParam extends BaseParam implements IQueryParameterType { private boolean myApproximate; - private QuantityDt myQuantity = new QuantityDt(); + private InternalQuantityDt myQuantity = new InternalQuantityDt(); /** * Constructor @@ -144,7 +143,7 @@ public class QuantityParam extends BaseParam implements IQueryParameterType { } public QuantityCompararatorEnum getComparator() { - return myQuantity.getComparator().getValueAsEnum(); + return myQuantity.getComparatorElement().getValueAsEnum(); } @Override @@ -153,15 +152,15 @@ public class QuantityParam extends BaseParam implements IQueryParameterType { } public UriDt getSystem() { - return myQuantity.getSystem(); + return myQuantity.getSystemElement(); } public String getUnits() { - return myQuantity.getUnits().getValue(); + return myQuantity.getUnitsElement().getValue(); } public DecimalDt getValue() { - return myQuantity.getValue(); + return myQuantity.getValueElement(); } @Override @@ -174,19 +173,19 @@ public class QuantityParam extends BaseParam implements IQueryParameterType { if (myApproximate) { b.append('~'); } else { - b.append(defaultString(escape(myQuantity.getComparator().getValue()))); + b.append(defaultString(escape(myQuantity.getComparatorElement().getValue()))); } - if (!myQuantity.getValue().isEmpty()) { - b.append(defaultString(escape(myQuantity.getValue().getValueAsString()))); + if (!myQuantity.getValueElement().isEmpty()) { + b.append(defaultString(escape(myQuantity.getValueElement().getValueAsString()))); } b.append('|'); - if (!myQuantity.getSystem().isEmpty()) { - b.append(defaultString(escape(myQuantity.getSystem().getValueAsString()))); + if (!myQuantity.getSystemElement().isEmpty()) { + b.append(defaultString(escape(myQuantity.getSystemElement().getValueAsString()))); } b.append('|'); - if (!myQuantity.getUnits().isEmpty()) { - b.append(defaultString(escape(myQuantity.getUnits().getValueAsString()))); + if (!myQuantity.getUnitsElement().isEmpty()) { + b.append(defaultString(escape(myQuantity.getUnitsElement().getValueAsString()))); } return b.toString(); @@ -302,10 +301,10 @@ public class QuantityParam extends BaseParam implements IQueryParameterType { @Override public String toString() { ToStringBuilder b = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE); - b.append("cmp", myQuantity.getComparator().getValueAsString()); - b.append("value", myQuantity.getValue().getValueAsString()); - b.append("system", myQuantity.getSystem().getValueAsString()); - b.append("units", myQuantity.getUnits().getValueAsString()); + b.append("cmp", myQuantity.getComparatorElement().getValueAsString()); + b.append("value", myQuantity.getValueElement().getValueAsString()); + b.append("system", myQuantity.getSystemElement().getValueAsString()); + b.append("units", myQuantity.getUnitsElement().getValueAsString()); if (getMissing() != null) { b.append("missing", getMissing()); } 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 481538011ba..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,8 +3,8 @@ package ca.uhn.fhir.rest.param; import java.util.ArrayList; import java.util.List; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; +import ca.uhn.fhir.model.base.composite.BaseCodingDt; +import ca.uhn.fhir.model.base.composite.BaseIdentifierDt; /* * #%L @@ -34,10 +34,10 @@ 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()) { - CodingDt nextCoding = next.getValueAsCoding(); + InternalCodingDt nextCoding = next.getValueAsCoding(); if (!nextCoding.isEmpty()) { retVal.add(nextCoding); } @@ -49,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(CodingDt theCodingDt) { + public void add(BaseCodingDt theCodingDt) { add(new TokenParam(theCodingDt)); } @@ -57,7 +57,7 @@ public class TokenOrListParam extends BaseOrListParam { * Convenience method which adds a token to this OR list * using the system and value from an identifier */ - public void add(IdentifierDt theIdentifierDt) { + public void add(BaseIdentifierDt theIdentifierDt) { add(new TokenParam(theIdentifierDt)); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/TokenParam.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/TokenParam.java index ec1f70305e1..eb26c01c255 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/TokenParam.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/TokenParam.java @@ -27,8 +27,8 @@ import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import ca.uhn.fhir.model.api.IQueryParameterType; -import ca.uhn.fhir.model.dstu.composite.CodingDt; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; +import ca.uhn.fhir.model.base.composite.BaseCodingDt; +import ca.uhn.fhir.model.base.composite.BaseIdentifierDt; import ca.uhn.fhir.model.primitive.UriDt; import ca.uhn.fhir.rest.server.Constants; @@ -57,13 +57,13 @@ public class TokenParam extends BaseParam implements IQueryParameterType { } /** - * Constructor which copies the {@link CodingDt#getSystem() system} and {@link CodingDt#getCode() code} from a {@link CodingDt} instance and adds it as a parameter + * Constructor which copies the {@link InternalCodingDt#getSystem() system} and {@link InternalCodingDt#getCode() code} from a {@link InternalCodingDt} instance and adds it as a parameter * * @param theCodingDt * The coding */ - public TokenParam(CodingDt theCodingDt) { - this(toSystemValue(theCodingDt.getSystem()), theCodingDt.getCode().getValue()); + public TokenParam(BaseCodingDt theCodingDt) { + this(toSystemValue(theCodingDt.getSystemElement()), theCodingDt.getCodeElement().getValue()); } /** @@ -72,8 +72,8 @@ public class TokenParam extends BaseParam implements IQueryParameterType { * @param theCodingDt * The coding */ - public TokenParam(IdentifierDt theIdentifierDt) { - this(toSystemValue(theIdentifierDt.getSystem()), theIdentifierDt.getValue().getValue()); + public TokenParam(BaseIdentifierDt theIdentifierDt) { + this(toSystemValue(theIdentifierDt.getSystemElement()), theIdentifierDt.getValueElement().getValue()); } private static String toSystemValue(UriDt theSystem) { @@ -170,8 +170,8 @@ public class TokenParam extends BaseParam implements IQueryParameterType { return builder.toString(); } - public CodingDt getValueAsCoding() { - return new CodingDt(mySystem, myValue); + public InternalCodingDt getValueAsCoding() { + return new InternalCodingDt(mySystem, myValue); } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java index e7cb8f347a4..48f0609146c 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java @@ -20,7 +20,7 @@ package ca.uhn.fhir.rest.server; * #L% */ -import static org.apache.commons.lang3.StringUtils.*; +import static org.apache.commons.lang3.StringUtils.isNotBlank; import java.io.IOException; import java.io.OutputStreamWriter; @@ -61,11 +61,10 @@ import ca.uhn.fhir.model.api.IResource; 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.base.resource.BaseOperationOutcome; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome.BaseIssue; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.resource.Binary; -import ca.uhn.fhir.model.dstu.resource.OperationOutcome; -import ca.uhn.fhir.model.dstu.resource.OperationOutcome.Issue; -import ca.uhn.fhir.model.dstu.valueset.IssueSeverityEnum; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.model.primitive.InstantDt; import ca.uhn.fhir.parser.IParser; @@ -82,8 +81,6 @@ import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor; -import ca.uhn.fhir.rest.server.provider.ServerConformanceProvider; -import ca.uhn.fhir.rest.server.provider.ServerProfileProvider; import ca.uhn.fhir.util.VersionUtil; public class RestfulServer extends HttpServlet { @@ -119,7 +116,7 @@ public class RestfulServer extends HttpServlet { public RestfulServer(FhirContext theCtx) { myFhirContext = theCtx; - myServerConformanceProvider = new ServerConformanceProvider(this); + myServerConformanceProvider = theCtx.getVersion().createServerConformanceProvider(this); } /** @@ -375,7 +372,7 @@ public class RestfulServer extends HttpServlet { } public IResourceProvider getServerProfilesProvider() { - return new ServerProfileProvider(getFhirContext()); + return myFhirContext.getVersion().createServerProfilesProvider(this); } /** @@ -638,7 +635,7 @@ public class RestfulServer extends HttpServlet { } catch (Throwable e) { - OperationOutcome oo = null; + BaseOperationOutcome oo = null; int statusCode = 500; if (e instanceof BaseServerResponseException) { @@ -647,19 +644,25 @@ public class RestfulServer extends HttpServlet { } if (oo == null) { - oo = new OperationOutcome(); - Issue issue = oo.addIssue(); - issue.getSeverity().setValueAsEnum(IssueSeverityEnum.ERROR); + try { + oo = (BaseOperationOutcome) myFhirContext.getResourceDefinition("OperationOutcome").getImplementingClass().newInstance(); + } catch (Exception e1) { + ourLog.error("Failed to instantiate OperationOutcome resource instance", e1); + throw new ServletException("Failed to instantiate OperationOutcome resource instance", e1); + } + + BaseIssue issue = oo.addIssue(); + issue.getSeverityElement().setValue("error"); if (e instanceof InternalErrorException) { ourLog.error("Failure during REST processing", e); - issue.getDetails().setValue(e.toString() + "\n\n" + ExceptionUtils.getStackTrace(e)); + issue.getDetailsElement().setValue(e.toString() + "\n\n" + ExceptionUtils.getStackTrace(e)); } else if (e instanceof BaseServerResponseException) { ourLog.warn("Failure during REST processing: {}", e.toString()); statusCode = ((BaseServerResponseException) e).getStatusCode(); - issue.getDetails().setValue(e.getMessage()); + issue.getDetailsElement().setValue(e.getMessage()); } else { ourLog.error("Failure during REST processing", e); - issue.getDetails().setValue(e.toString() + "\n\n" + ExceptionUtils.getStackTrace(e)); + issue.getDetailsElement().setValue(e.toString() + "\n\n" + ExceptionUtils.getStackTrace(e)); } } @@ -979,7 +982,7 @@ public class RestfulServer extends HttpServlet { for (IResource next : resourceList) { if (next.getId() == null || next.getId().isEmpty()) { - if (!(next instanceof OperationOutcome)) { + if (!(next instanceof BaseOperationOutcome)) { throw new InternalErrorException("Server method returned resource of type[" + next.getClass().getSimpleName() + "] with no ID specified (IResource#setId(IdDt) must be called)"); } } @@ -1179,6 +1182,11 @@ public class RestfulServer extends HttpServlet { return EncodingEnum.XML; } + /** + * Determine whether a response should be given in JSON or XML format based on the + * incoming HttpServletRequest's "_format" parameter and "Accept:" + * HTTP header. + */ public static EncodingEnum determineResponseEncoding(HttpServletRequest theReq) { String[] format = theReq.getParameterValues(Constants.PARAM_FORMAT); if (format != null) { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/BaseServerResponseException.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/BaseServerResponseException.java index c9be30ae072..98e5606b28a 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/BaseServerResponseException.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/BaseServerResponseException.java @@ -4,7 +4,7 @@ import java.lang.reflect.InvocationTargetException; import java.util.HashMap; import java.util.Map; -import ca.uhn.fhir.model.dstu.resource.OperationOutcome; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; /* * #%L @@ -49,7 +49,7 @@ public abstract class BaseServerResponseException extends RuntimeException { registerExceptionType(NotImplementedOperationException.STATUS_CODE, NotImplementedOperationException.class); } - private OperationOutcome myOperationOutcome; + private BaseOperationOutcome myBaseOperationOutcome; private String myResponseBody; private String myResponseMimeType; private int myStatusCode; @@ -65,7 +65,7 @@ public abstract class BaseServerResponseException extends RuntimeException { public BaseServerResponseException(int theStatusCode, String theMessage) { super(theMessage); myStatusCode = theStatusCode; - myOperationOutcome = null; + myBaseOperationOutcome = null; } /** @@ -75,14 +75,14 @@ public abstract class BaseServerResponseException extends RuntimeException { * The HTTP status code corresponding to this problem * @param theMessage * The message - * @param theOperationOutcome - * An OperationOutcome resource to return to the calling client (in a server) or the OperationOutcome + * @param theBaseOperationOutcome + * An BaseOperationOutcome resource to return to the calling client (in a server) or the BaseOperationOutcome * that was returned from the server (in a client) */ - public BaseServerResponseException(int theStatusCode, String theMessage, OperationOutcome theOperationOutcome) { + public BaseServerResponseException(int theStatusCode, String theMessage, BaseOperationOutcome theBaseOperationOutcome) { super(theMessage); myStatusCode = theStatusCode; - myOperationOutcome = theOperationOutcome; + myBaseOperationOutcome = theBaseOperationOutcome; } /** @@ -98,7 +98,7 @@ public abstract class BaseServerResponseException extends RuntimeException { public BaseServerResponseException(int theStatusCode, String theMessage, Throwable theCause) { super(theMessage, theCause); myStatusCode = theStatusCode; - myOperationOutcome = null; + myBaseOperationOutcome = null; } /** @@ -110,14 +110,14 @@ public abstract class BaseServerResponseException extends RuntimeException { * The message * @param theCause * The underlying cause exception - * @param theOperationOutcome - * An OperationOutcome resource to return to the calling client (in a server) or the OperationOutcome + * @param theBaseOperationOutcome + * An BaseOperationOutcome resource to return to the calling client (in a server) or the BaseOperationOutcome * that was returned from the server (in a client) */ - public BaseServerResponseException(int theStatusCode, String theMessage, Throwable theCause, OperationOutcome theOperationOutcome) { + public BaseServerResponseException(int theStatusCode, String theMessage, Throwable theCause, BaseOperationOutcome theBaseOperationOutcome) { super(theMessage, theCause); myStatusCode = theStatusCode; - myOperationOutcome = theOperationOutcome; + myBaseOperationOutcome = theBaseOperationOutcome; } /** @@ -131,7 +131,7 @@ public abstract class BaseServerResponseException extends RuntimeException { public BaseServerResponseException(int theStatusCode, Throwable theCause) { super(theCause.toString(), theCause); myStatusCode = theStatusCode; - myOperationOutcome = null; + myBaseOperationOutcome = null; } /** @@ -141,21 +141,21 @@ public abstract class BaseServerResponseException extends RuntimeException { * The HTTP status code corresponding to this problem * @param theCause * The underlying cause exception - * @param theOperationOutcome - * An OperationOutcome resource to return to the calling client (in a server) or the OperationOutcome + * @param theBaseOperationOutcome + * An BaseOperationOutcome resource to return to the calling client (in a server) or the BaseOperationOutcome * that was returned from the server (in a client) */ - public BaseServerResponseException(int theStatusCode, Throwable theCause, OperationOutcome theOperationOutcome) { + public BaseServerResponseException(int theStatusCode, Throwable theCause, BaseOperationOutcome theBaseOperationOutcome) { super(theCause.toString(), theCause); myStatusCode = theStatusCode; - myOperationOutcome = theOperationOutcome; + myBaseOperationOutcome = theBaseOperationOutcome; } /** - * Returns the {@link OperationOutcome} resource if any which was supplied in the response, or null + * Returns the {@link BaseOperationOutcome} resource if any which was supplied in the response, or null */ - public OperationOutcome getOperationOutcome() { - return myOperationOutcome; + public BaseOperationOutcome getOperationOutcome() { + return myBaseOperationOutcome; } /** @@ -188,14 +188,14 @@ public abstract class BaseServerResponseException extends RuntimeException { } /** - * Sets the OperationOutcome resource associated with this exception. In server + * Sets the BaseOperationOutcome resource associated with this exception. In server * implementations, this is the OperartionOutcome resource to include with the HTTP response. In * client implementations you should not call this method. * - * @param theOperationOutcome The OperationOutcome resource + * @param theBaseOperationOutcome The BaseOperationOutcome resource */ - public void setOperationOutcome(OperationOutcome theOperationOutcome) { - myOperationOutcome = theOperationOutcome; + public void setOperationOutcome(BaseOperationOutcome theBaseOperationOutcome) { + myBaseOperationOutcome = theBaseOperationOutcome; } /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/InternalErrorException.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/InternalErrorException.java index 3466517e906..61adc584c9d 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/InternalErrorException.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/InternalErrorException.java @@ -1,6 +1,6 @@ package ca.uhn.fhir.rest.server.exceptions; -import ca.uhn.fhir.model.dstu.resource.OperationOutcome; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; import ca.uhn.fhir.rest.server.Constants; /* @@ -52,7 +52,7 @@ public class InternalErrorException extends BaseServerResponseException { * The message * @param theOperationOutcome The OperationOutcome resource to return to the client */ - public InternalErrorException(String theMessage, OperationOutcome theOperationOutcome) { + public InternalErrorException(String theMessage, BaseOperationOutcome theOperationOutcome) { super(STATUS_CODE, theMessage, theOperationOutcome); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/InvalidRequestException.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/InvalidRequestException.java index 56e9d5730db..16f9a4491f5 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/InvalidRequestException.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/InvalidRequestException.java @@ -1,6 +1,6 @@ package ca.uhn.fhir.rest.server.exceptions; -import ca.uhn.fhir.model.dstu.resource.OperationOutcome; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; import ca.uhn.fhir.rest.server.Constants; /* @@ -52,7 +52,7 @@ public class InvalidRequestException extends BaseServerResponseException { * The message * @param theOperationOutcome The OperationOutcome resource to return to the client */ - public InvalidRequestException(String theMessage, OperationOutcome theOperationOutcome) { + public InvalidRequestException(String theMessage, BaseOperationOutcome theOperationOutcome) { super(STATUS_CODE, theMessage, theOperationOutcome); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/MethodNotAllowedException.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/MethodNotAllowedException.java index a7c4953358c..28705974e06 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/MethodNotAllowedException.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/MethodNotAllowedException.java @@ -1,6 +1,6 @@ package ca.uhn.fhir.rest.server.exceptions; -import ca.uhn.fhir.model.dstu.resource.OperationOutcome; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; import ca.uhn.fhir.rest.server.Constants; /* @@ -44,7 +44,7 @@ public class MethodNotAllowedException extends BaseServerResponseException { * The message * @param theOperationOutcome The OperationOutcome resource to return to the client */ - public MethodNotAllowedException(String theMessage, OperationOutcome theOperationOutcome) { + public MethodNotAllowedException(String theMessage, BaseOperationOutcome theOperationOutcome) { super(STATUS_CODE, theMessage, theOperationOutcome); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/NotImplementedOperationException.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/NotImplementedOperationException.java index ff62d0b8db9..0894a3d42ac 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/NotImplementedOperationException.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/NotImplementedOperationException.java @@ -1,5 +1,5 @@ package ca.uhn.fhir.rest.server.exceptions; -import ca.uhn.fhir.model.dstu.resource.OperationOutcome; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; import ca.uhn.fhir.rest.server.Constants; /* @@ -54,7 +54,7 @@ public static final int STATUS_CODE = Constants.STATUS_HTTP_501_NOT_IMPLEMENTED; * The message * @param theOperationOutcome The OperationOutcome resource to return to the client */ - public NotImplementedOperationException(String theMessage, OperationOutcome theOperationOutcome) { + public NotImplementedOperationException(String theMessage, BaseOperationOutcome theOperationOutcome) { super(STATUS_CODE, theMessage, theOperationOutcome); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/ResourceGoneException.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/ResourceGoneException.java index ebfbc429e8d..d7f111f33b6 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/ResourceGoneException.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/ResourceGoneException.java @@ -21,8 +21,8 @@ package ca.uhn.fhir.rest.server.exceptions; */ import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.resource.OperationOutcome; +import ca.uhn.fhir.model.base.composite.BaseIdentifierDt; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.rest.server.Constants; @@ -38,7 +38,7 @@ public class ResourceGoneException extends BaseServerResponseException { super(STATUS_CODE, "Resource " + (theId != null ? theId.getValue() : "") + " is gone/deleted"); } - public ResourceGoneException(Class theClass, IdentifierDt thePatientId) { + public ResourceGoneException(Class theClass, BaseIdentifierDt thePatientId) { super(STATUS_CODE, "Resource of type " + theClass.getSimpleName() + " with ID " + thePatientId + " is gone/deleted"); } @@ -53,7 +53,7 @@ public class ResourceGoneException extends BaseServerResponseException { * The message * @param theOperationOutcome The OperationOutcome resource to return to the client */ - public ResourceGoneException(String theMessage, OperationOutcome theOperationOutcome) { + public ResourceGoneException(String theMessage, BaseOperationOutcome theOperationOutcome) { super(STATUS_CODE, theMessage, theOperationOutcome); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/ResourceNotFoundException.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/ResourceNotFoundException.java index 152a002d98c..8633ec31b47 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/ResourceNotFoundException.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/ResourceNotFoundException.java @@ -21,8 +21,8 @@ package ca.uhn.fhir.rest.server.exceptions; */ import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.dstu.composite.IdentifierDt; -import ca.uhn.fhir.model.dstu.resource.OperationOutcome; +import ca.uhn.fhir.model.base.composite.BaseIdentifierDt; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.rest.server.Constants; @@ -39,7 +39,7 @@ public class ResourceNotFoundException extends BaseServerResponseException { super(STATUS_CODE, createErrorMessage(theClass, theId)); } - public ResourceNotFoundException(Class theClass, IdDt theId, OperationOutcome theOperationOutcome) { + public ResourceNotFoundException(Class theClass, IdDt theId, BaseOperationOutcome theOperationOutcome) { super(STATUS_CODE, createErrorMessage(theClass, theId), theOperationOutcome); } @@ -50,14 +50,14 @@ public class ResourceNotFoundException extends BaseServerResponseException { * The message * @param theOperationOutcome The OperationOutcome resource to return to the client */ - public ResourceNotFoundException(String theMessage, OperationOutcome theOperationOutcome) { + public ResourceNotFoundException(String theMessage, BaseOperationOutcome theOperationOutcome) { super(STATUS_CODE, theMessage, theOperationOutcome); } /** * @deprecated This doesn't make sense, since an identifier is not a resource ID and shouldn't generate a 404 if it isn't found - Should be removed */ - public ResourceNotFoundException(Class theClass, IdentifierDt theId) { + public ResourceNotFoundException(Class theClass, BaseIdentifierDt theId) { super(STATUS_CODE, "Resource of type " + theClass.getSimpleName() + " with ID " + theId + " is not known"); } @@ -65,7 +65,7 @@ public class ResourceNotFoundException extends BaseServerResponseException { super(STATUS_CODE, createErrorMessage(theId)); } - public ResourceNotFoundException(IdDt theId, OperationOutcome theOperationOutcome) { + public ResourceNotFoundException(IdDt theId, BaseOperationOutcome theOperationOutcome) { super(STATUS_CODE, createErrorMessage(theId), theOperationOutcome); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/ResourceVersionConflictException.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/ResourceVersionConflictException.java index 142216781ca..a2c02866153 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/ResourceVersionConflictException.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/ResourceVersionConflictException.java @@ -20,7 +20,7 @@ package ca.uhn.fhir.rest.server.exceptions; * #L% */ -import ca.uhn.fhir.model.dstu.resource.OperationOutcome; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; import ca.uhn.fhir.rest.annotation.Delete; import ca.uhn.fhir.rest.annotation.Update; import ca.uhn.fhir.rest.server.Constants; @@ -45,7 +45,7 @@ public class ResourceVersionConflictException extends BaseServerResponseExceptio * The message * @param theOperationOutcome The OperationOutcome resource to return to the client */ - public ResourceVersionConflictException(String theMessage, OperationOutcome theOperationOutcome) { + public ResourceVersionConflictException(String theMessage, BaseOperationOutcome theOperationOutcome) { super(STATUS_CODE, theMessage, theOperationOutcome); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/ResourceVersionNotSpecifiedException.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/ResourceVersionNotSpecifiedException.java index e8854e0c328..32ceed2c6a7 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/ResourceVersionNotSpecifiedException.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/ResourceVersionNotSpecifiedException.java @@ -20,7 +20,7 @@ package ca.uhn.fhir.rest.server.exceptions; * #L% */ -import ca.uhn.fhir.model.dstu.resource.OperationOutcome; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; import ca.uhn.fhir.rest.annotation.Update; import ca.uhn.fhir.rest.server.Constants; @@ -44,7 +44,7 @@ public class ResourceVersionNotSpecifiedException extends BaseServerResponseExce * The message * @param theOperationOutcome The OperationOutcome resource to return to the client */ - public ResourceVersionNotSpecifiedException(String theMessage, OperationOutcome theOperationOutcome) { + public ResourceVersionNotSpecifiedException(String theMessage, BaseOperationOutcome theOperationOutcome) { super(STATUS_CODE, theMessage, theOperationOutcome); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/UnclassifiedServerFailureException.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/UnclassifiedServerFailureException.java index f35bc8971be..6fe2141a3e9 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/UnclassifiedServerFailureException.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/UnclassifiedServerFailureException.java @@ -1,6 +1,6 @@ package ca.uhn.fhir.rest.server.exceptions; -import ca.uhn.fhir.model.dstu.resource.OperationOutcome; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; /* * #%L @@ -49,7 +49,7 @@ public class UnclassifiedServerFailureException extends BaseServerResponseExcept * The message to add to the status line * @param theOperationOutcome The OperationOutcome resource to return to the client */ - public UnclassifiedServerFailureException(int theStatusCode, String theMessage, OperationOutcome theOperationOutcome) { + public UnclassifiedServerFailureException(int theStatusCode, String theMessage, BaseOperationOutcome theOperationOutcome) { super(theStatusCode, theMessage, theOperationOutcome); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/UnprocessableEntityException.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/UnprocessableEntityException.java index a8fa6ff2234..21dc34530fc 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/UnprocessableEntityException.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/UnprocessableEntityException.java @@ -20,14 +20,23 @@ package ca.uhn.fhir.rest.server.exceptions; * #L% */ -import ca.uhn.fhir.model.dstu.resource.OperationOutcome; +import java.util.List; +import java.util.Map; + +import ca.uhn.fhir.model.api.IElement; +import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; +import ca.uhn.fhir.model.dstu.composite.ContainedDt; +import ca.uhn.fhir.model.dstu.composite.NarrativeDt; +import ca.uhn.fhir.model.primitive.CodeDt; +import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.rest.server.Constants; /** * Represents an HTTP 422 Unprocessable Entity response, which means that a resource was rejected by the server because it "violated applicable FHIR profiles or server business rules". * *

- * This exception will generally contain an {@link OperationOutcome} instance which details the failure. + * This exception will generally contain an {@link BaseOperationOutcome} instance which details the failure. *

* * @see InvalidRequestException Which corresponds to an HTTP 400 Bad Request failure @@ -43,44 +52,32 @@ public class UnprocessableEntityException extends BaseServerResponseException { * * @param theMessage * The message to add to the status line - * @param theOperationOutcome The OperationOutcome resource to return to the client + * @param theOperationOutcome The BaseOperationOutcome resource to return to the client */ - public UnprocessableEntityException(String theMessage, OperationOutcome theOperationOutcome) { + public UnprocessableEntityException(String theMessage, BaseOperationOutcome theOperationOutcome) { super(STATUS_CODE, theMessage, theOperationOutcome); } /** - * Constructor which accepts an {@link OperationOutcome} resource which will be supplied in the response + * Constructor which accepts an {@link BaseOperationOutcome} resource which will be supplied in the response */ - public UnprocessableEntityException(OperationOutcome theOperationOutcome) { - super(STATUS_CODE, DEFAULT_MESSAGE, theOperationOutcome == null ? new OperationOutcome() : theOperationOutcome); + public UnprocessableEntityException(BaseOperationOutcome theOperationOutcome) { + super(STATUS_CODE, DEFAULT_MESSAGE, theOperationOutcome); } /** - * Constructor which accepts a String describing the issue. This string will be translated into an {@link OperationOutcome} resource which will be supplied in the response. + * Constructor which accepts a String describing the issue. This string will be translated into an {@link BaseOperationOutcome} resource which will be supplied in the response. */ public UnprocessableEntityException(String theMessage) { - super(STATUS_CODE, DEFAULT_MESSAGE, toOperationOutcome(theMessage)); + super(STATUS_CODE, theMessage); } /** - * Constructor which accepts an array of Strings describing the issue. This strings will be translated into an {@link OperationOutcome} resource which will be supplied in the response. + * Constructor which accepts an array of Strings describing the issue. This strings will be translated into an {@link BaseOperationOutcome} resource which will be supplied in the response. */ public UnprocessableEntityException(String... theMessage) { - super(STATUS_CODE, DEFAULT_MESSAGE, toOperationOutcome(theMessage)); + super(STATUS_CODE, theMessage[0]); // TODO: this used to generate an OperationOutcome - why? } - private static OperationOutcome toOperationOutcome(String... theMessage) { - OperationOutcome OperationOutcome = new OperationOutcome(); - if (theMessage != null) { - for (String next : theMessage) { - OperationOutcome.addIssue().setDetails(next); - } - } - return OperationOutcome; - } - - - } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/UnprocessableEntityException.java.orig b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/UnprocessableEntityException.java.orig new file mode 100644 index 00000000000..715bfe36456 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/UnprocessableEntityException.java.orig @@ -0,0 +1,99 @@ +package ca.uhn.fhir.rest.server.exceptions; + +/* + * #%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 java.util.Map; + +import ca.uhn.fhir.model.api.IElement; +import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; +import ca.uhn.fhir.model.dstu.composite.ContainedDt; +import ca.uhn.fhir.model.dstu.composite.NarrativeDt; +import ca.uhn.fhir.model.primitive.CodeDt; +import ca.uhn.fhir.model.primitive.IdDt; +import ca.uhn.fhir.rest.server.Constants; + +/** + * Represents an HTTP 422 Unprocessable Entity response, which means that a resource was rejected by the server because it "violated applicable FHIR profiles or server business rules". + * + *

+ * This exception will generally contain an {@link BaseOperationOutcome} instance which details the failure. + *

+ * + * @see InvalidRequestException Which corresponds to an HTTP 400 Bad Request failure + */ +public class UnprocessableEntityException extends BaseServerResponseException { + + private static final String DEFAULT_MESSAGE = "Unprocessable Entity"; + private static final long serialVersionUID = 1L; + public static final int STATUS_CODE = Constants.STATUS_HTTP_422_UNPROCESSABLE_ENTITY; + + /** + * Constructor + * + * @param theMessage + * The message to add to the status line + * @param theOperationOutcome The BaseOperationOutcome resource to return to the client + */ + public UnprocessableEntityException(String theMessage, BaseOperationOutcome theOperationOutcome) { + super(STATUS_CODE, theMessage, theOperationOutcome); + } + + + /** + * Constructor which accepts an {@link BaseOperationOutcome} resource which will be supplied in the response + */ + public UnprocessableEntityException(BaseOperationOutcome theOperationOutcome) { + super(STATUS_CODE, DEFAULT_MESSAGE, theOperationOutcome); + } + + /** + * Constructor which accepts a String describing the issue. This string will be translated into an {@link BaseOperationOutcome} resource which will be supplied in the response. + */ + public UnprocessableEntityException(String theMessage) { + super(STATUS_CODE, theMessage); + } + + /** + * Constructor which accepts an array of Strings describing the issue. This strings will be translated into an {@link BaseOperationOutcome} resource which will be supplied in the response. + */ + public UnprocessableEntityException(String... theMessage) { +<<<<<<< HEAD + super(STATUS_CODE, DEFAULT_MESSAGE, toOperationOutcome(theMessage)); + } + + private static OperationOutcome toOperationOutcome(String... theMessage) { + OperationOutcome OperationOutcome = new OperationOutcome(); + if (theMessage != null) { + for (String next : theMessage) { + OperationOutcome.addIssue().setDetails(next); + } + } + return OperationOutcome; +======= + super(STATUS_CODE, theMessage[0]); // TODO: this used to generate an OperationOutcome - why? +>>>>>>> versions + } + + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/interceptor/IServerInterceptor.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/interceptor/IServerInterceptor.java index 5c8246cb9a4..67cbf4f3548 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/interceptor/IServerInterceptor.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/interceptor/IServerInterceptor.java @@ -29,7 +29,7 @@ import javax.servlet.http.HttpServletResponse; import ca.uhn.fhir.model.api.Bundle; import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.api.TagList; -import ca.uhn.fhir.model.dstu.resource.OperationOutcome; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; import ca.uhn.fhir.rest.annotation.Read; import ca.uhn.fhir.rest.annotation.Search; import ca.uhn.fhir.rest.method.RequestDetails; @@ -166,7 +166,7 @@ public interface IServerInterceptor { * {@link Read} methods) as well as any runtime exceptions thrown by the server itself. This also includes any {@link AuthenticationException}s thrown. *

* Implementations of this method may choose to ignore/log/count/etc exceptions, and return true. In this case, processing will continue, and the server will automatically generate an - * {@link OperationOutcome OperationOutcome}. Implementations may also choose to provide their own response to the client. In this case, they should return false, to indicate that + * {@link BaseOperationOutcome OperationOutcome}. Implementations may also choose to provide their own response to the client. In this case, they should return false, to indicate that * they have handled the request and processing should stop. *

* diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/FhirValidator.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/FhirValidator.java index 652d89941c2..284be21462a 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/FhirValidator.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/FhirValidator.java @@ -20,11 +20,16 @@ package ca.uhn.fhir.validation; * #L% */ +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.apache.commons.lang3.Validate; + 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.dstu.resource.OperationOutcome; -import org.apache.commons.lang3.Validate; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; import java.util.ArrayList; import java.util.Iterator; @@ -138,10 +143,19 @@ public class FhirValidator { */ @Deprecated public void validate(Bundle theBundle) { - ValidationResult validationResult = validateWithResult(theBundle); - if (!validationResult.isSuccessful()) { - throw new ValidationFailureException(validationResult.getOperationOutcome()); - } + Validate.notNull(theBundle, "theBundle must not be null"); + + ValidationContext ctx = ValidationContext.forBundle(myContext, theBundle); + + for (IValidator next : myValidators) { + next.validateBundle(ctx); + } + + BaseOperationOutcome oo = ctx.getOperationOutcome(); + if (oo != null && oo.getIssue().size() > 0) { + throw new ValidationFailureException(oo); + } + } /** @@ -174,11 +188,11 @@ public class FhirValidator { ValidationContext ctx = ValidationContext.forBundle(myContext, theBundle); - for (IValidator next : myValidators) { - next.validateBundle(ctx); - } + for (IValidator next : myValidators) { + next.validateBundle(ctx); + } - OperationOutcome oo = ctx.getOperationOutcome(); + BaseOperationOutcome oo = ctx.getOperationOutcome(); return ValidationResult.valueOf(oo); } @@ -198,7 +212,7 @@ public class FhirValidator { next.validateResource(ctx); } - OperationOutcome oo = ctx.getOperationOutcome(); + BaseOperationOutcome oo = ctx.getOperationOutcome(); return ValidationResult.valueOf(oo); } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/FhirValidator.java.orig b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/FhirValidator.java.orig new file mode 100644 index 00000000000..02e4883e3aa --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/FhirValidator.java.orig @@ -0,0 +1,251 @@ +package ca.uhn.fhir.validation; + +/* + * #%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% + */ + +<<<<<<< HEAD +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.dstu.resource.OperationOutcome; +import org.apache.commons.lang3.Validate; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +======= +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.apache.commons.lang3.Validate; + +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.BaseOperationOutcome; +>>>>>>> versions + +/** + * Resource validator, which checks resources for compliance against various validation schemes (schemas, schematrons, etc.) + * + *

+ * To obtain a resource validator, call {@link FhirContext#newValidator()} + *

+ */ +public class FhirValidator { + + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirValidator.class); + + private static final String I18N_KEY_NO_PHLOC_WARNING = FhirValidator.class.getName()+".noPhlocWarningOnStartup"; + private static final String I18N_KEY_NO_PHLOC_ERROR = FhirValidator.class.getName()+".noPhlocError"; + + private FhirContext myContext; + private List myValidators = new ArrayList(); + private static volatile Boolean ourPhlocPresentOnClasspath; + + /** + * Constructor (this should not be called directly, but rather {@link FhirContext#newValidator()} should be called to obtain an instance of {@link FhirValidator}) + */ + public FhirValidator(FhirContext theFhirContext) { + myContext = theFhirContext; + setValidateAgainstStandardSchema(true); + + if (ourPhlocPresentOnClasspath == null) { + try { + Class.forName("com.phloc.schematron.ISchematronResource"); + ourPhlocPresentOnClasspath = true; + } catch (ClassNotFoundException e) { + ourLog.info(theFhirContext.getLocalizer().getMessage(I18N_KEY_NO_PHLOC_WARNING)); + ourPhlocPresentOnClasspath = false; + } + } + if (ourPhlocPresentOnClasspath) { + setValidateAgainstStandardSchematron(true); + } + + } + + private void addOrRemoveValidator(boolean theValidateAgainstStandardSchema, Class type, IValidator instance) { + if (theValidateAgainstStandardSchema) { + boolean found = haveValidatorOfType(type); + if (!found) { + myValidators.add(instance); + } + } else { + for (Iterator iter = myValidators.iterator(); iter.hasNext();) { + IValidator next = iter.next(); + if (next.getClass().equals(type)) { + iter.remove(); + } + } + } + } + + private boolean haveValidatorOfType(Class type) { + boolean found = false; + for (IValidator next : myValidators) { + if (next.getClass().equals(type)) { + found = true; + } + } + return found; + } + + /** + * Should the validator validate the resource against the base schema (the schema provided with the FHIR distribution itself) + */ + public boolean isValidateAgainstStandardSchema() { + return haveValidatorOfType(SchemaBaseValidator.class); + } + + /** + * Should the validator validate the resource against the base schema (the schema provided with the FHIR distribution itself) + */ + public boolean isValidateAgainstStandardSchematron() { + return haveValidatorOfType(SchematronBaseValidator.class); + } + + /** + * Should the validator validate the resource against the base schema (the schema provided with the FHIR distribution itself) + */ + public void setValidateAgainstStandardSchema(boolean theValidateAgainstStandardSchema) { + addOrRemoveValidator(theValidateAgainstStandardSchema, SchemaBaseValidator.class, new SchemaBaseValidator()); + } + + /** + * Should the validator validate the resource against the base schematron (the schematron provided with the FHIR distribution itself) + */ + public void setValidateAgainstStandardSchematron(boolean theValidateAgainstStandardSchematron) { + if (theValidateAgainstStandardSchematron && !ourPhlocPresentOnClasspath) { + throw new IllegalArgumentException(myContext.getLocalizer().getMessage(I18N_KEY_NO_PHLOC_ERROR)); + } + addOrRemoveValidator(theValidateAgainstStandardSchematron, SchematronBaseValidator.class, new SchematronBaseValidator()); + } + + /** + * Validates a bundle instance, throwing a {@link ValidationFailureException} if the validation fails. This validation includes validation of all resources in the bundle. + * + * @param theBundle + * The resource to validate + * @throws ValidationFailureException + * If the validation fails + * @deprecated use {@link #validateWithResult(ca.uhn.fhir.model.api.Bundle)} instead + */ + @Deprecated + public void validate(Bundle theBundle) { +<<<<<<< HEAD + ValidationResult validationResult = validateWithResult(theBundle); + if (!validationResult.isSuccessful()) { + throw new ValidationFailureException(validationResult.getOperationOutcome()); + } +======= + Validate.notNull(theBundle, "theBundle must not be null"); + + ValidationContext ctx = ValidationContext.forBundle(myContext, theBundle); + + for (IValidator next : myValidators) { + next.validateBundle(ctx); + } + + BaseOperationOutcome oo = ctx.getOperationOutcome(); + if (oo != null && oo.getIssue().size() > 0) { + throw new ValidationFailureException(oo); + } + +>>>>>>> versions + } + + /** + * Validates a resource instance, throwing a {@link ValidationFailureException} if the validation fails + * + * @param theResource + * The resource to validate + * @throws ValidationFailureException + * If the validation fails + * @deprecated use {@link #validateWithResult(ca.uhn.fhir.model.api.IResource)} instead + */ + @Deprecated + public void validate(IResource theResource) throws ValidationFailureException { +<<<<<<< HEAD + ValidationResult validationResult = validateWithResult(theResource); + if (!validationResult.isSuccessful()) { + throw new ValidationFailureException(validationResult.getOperationOutcome()); + } + } + + /** + * Validates a bundle instance returning a {@link ca.uhn.fhir.validation.ValidationResult} which contains the results. + * This validation includes validation of all resources in the bundle. + * + * @param theBundle the bundle to validate + * @return the results of validation + * @since 0.7 + */ + public ValidationResult validateWithResult(Bundle theBundle) { + Validate.notNull(theBundle, "theBundle must not be null"); + + ValidationContext ctx = ValidationContext.forBundle(myContext, theBundle); + + for (IValidator next : myValidators) { + next.validateBundle(ctx); + } + + OperationOutcome oo = ctx.getOperationOutcome(); + return ValidationResult.valueOf(oo); + } + + /** + * Validates a resource instance returning a {@link ca.uhn.fhir.validation.ValidationResult} which contains the results. + * + * @param theResource the resource to validate + * @return the results of validation + * @since 0.7 + */ + public ValidationResult validateWithResult(IResource theResource) { + Validate.notNull(theResource, "theResource must not be null"); + + ValidationContext ctx = ValidationContext.forResource(myContext, theResource); + + for (IValidator next : myValidators) { + next.validateResource(ctx); + } + + OperationOutcome oo = ctx.getOperationOutcome(); + return ValidationResult.valueOf(oo); + } +======= + Validate.notNull(theResource, "theResource must not be null"); + + ValidationContext ctx = ValidationContext.forResource(myContext, theResource); + + for (IValidator next : myValidators) { + next.validateResource(ctx); + } + + BaseOperationOutcome oo = ctx.getOperationOutcome(); + if (oo != null && oo.getIssue().size() > 0) { + throw new ValidationFailureException(oo); + } + + } + +>>>>>>> versions +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/SchemaBaseValidator.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/SchemaBaseValidator.java index 7dd7e857f3b..4eb22d93515 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/SchemaBaseValidator.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/SchemaBaseValidator.java @@ -20,12 +20,10 @@ package ca.uhn.fhir.validation; * #L% */ -import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.StringReader; -import java.io.UnsupportedEncodingException; import java.nio.charset.Charset; import java.util.Collections; import java.util.HashMap; @@ -40,7 +38,6 @@ import javax.xml.validation.Schema; import javax.xml.validation.SchemaFactory; import javax.xml.validation.Validator; -import org.apache.commons.io.IOUtils; import org.apache.commons.io.input.BOMInputStream; import org.w3c.dom.ls.LSInput; import org.w3c.dom.ls.LSResourceResolver; @@ -50,8 +47,7 @@ import org.xml.sax.SAXParseException; import ca.uhn.fhir.context.ConfigurationException; import ca.uhn.fhir.model.api.Bundle; import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.dstu.resource.OperationOutcome.Issue; -import ca.uhn.fhir.model.dstu.valueset.IssueSeverityEnum; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome.BaseIssue; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; class SchemaBaseValidator implements IValidator { @@ -121,7 +117,7 @@ class SchemaBaseValidator implements IValidator { ourLog.debug("Going to load resource: {}", pathToBase); InputStream baseIs = FhirValidator.class.getClassLoader().getResourceAsStream(pathToBase); if (baseIs == null) { - throw new ValidationFailureException("No FHIR-BASE schema found"); + throw new InternalErrorException("No FHIR-BASE schema found"); } baseIs = new BOMInputStream(baseIs, false); InputStreamReader baseReader = new InputStreamReader(baseIs, Charset.forName("UTF-8")); @@ -159,26 +155,26 @@ class SchemaBaseValidator implements IValidator { myContext = theContext; } - private void addIssue(SAXParseException theException, IssueSeverityEnum severity) { - Issue issue = myContext.getOperationOutcome().addIssue(); - issue.setSeverity(severity); - issue.setDetails(theException.getLocalizedMessage()); - issue.addLocation().setValue("Line[" + theException.getLineNumber() + "] Col[" + theException.getColumnNumber() + "]"); + private void addIssue(SAXParseException theException, String severity) { + BaseIssue issue = myContext.getOperationOutcome().addIssue(); + issue.getSeverityElement().setValue(severity); + issue.getDetailsElement().setValue(theException.getLocalizedMessage()); + issue.addLocation("Line[" + theException.getLineNumber() + "] Col[" + theException.getColumnNumber() + "]"); } @Override public void error(SAXParseException theException) throws SAXException { - addIssue(theException, IssueSeverityEnum.ERROR); + addIssue(theException, "error"); } @Override public void fatalError(SAXParseException theException) throws SAXException { - addIssue(theException, IssueSeverityEnum.FATAL); + addIssue(theException, "fatal"); } @Override public void warning(SAXParseException theException) throws SAXException { - addIssue(theException, IssueSeverityEnum.WARNING); + addIssue(theException, "warning"); } } @@ -203,7 +199,7 @@ class SchemaBaseValidator implements IValidator { InputStream baseIs = FhirValidator.class.getClassLoader().getResourceAsStream(pathToBase); if (baseIs == null) { - throw new ValidationFailureException("No FHIR-BASE schema found"); + throw new InternalErrorException("No FHIR-BASE schema found"); } input.setByteStream(baseIs); diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/SchematronBaseValidator.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/SchematronBaseValidator.java index 9ad02d960ca..3f764dff327 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/SchematronBaseValidator.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/SchematronBaseValidator.java @@ -33,8 +33,9 @@ import org.oclc.purl.dsdl.svrl.SchematronOutputType; import ca.uhn.fhir.model.api.Bundle; import ca.uhn.fhir.model.api.BundleEntry; import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.dstu.resource.OperationOutcome.Issue; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome.BaseIssue; import ca.uhn.fhir.model.dstu.valueset.IssueSeverityEnum; +import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import com.phloc.commons.error.IResourceError; import com.phloc.commons.error.IResourceErrorGroup; @@ -64,23 +65,23 @@ public class SchematronBaseValidator implements IValidator { } for (IResourceError next : errors.getAllErrors().getAllResourceErrors()) { - Issue issue = theCtx.getOperationOutcome().addIssue(); + BaseIssue issue = theCtx.getOperationOutcome().addIssue(); switch (next.getErrorLevel()) { case ERROR: - issue.setSeverity(IssueSeverityEnum.ERROR); + issue.getSeverityElement().setValue("error"); break; case FATAL_ERROR: - issue.setSeverity(IssueSeverityEnum.FATAL); + issue.getSeverityElement().setValue("fatal"); break; case WARN: - issue.setSeverity(IssueSeverityEnum.WARNING); + issue.getSeverityElement().setValue("warning"); break; case INFO: case SUCCESS: continue; } - issue.getDetails().setValue(next.getAsString(Locale.getDefault())); + issue.getDetailsElement().setValue(next.getAsString(Locale.getDefault())); } } @@ -103,7 +104,7 @@ public class SchematronBaseValidator implements IValidator { + ".sch"; InputStream baseIs = FhirValidator.class.getClassLoader().getResourceAsStream(pathToBase); if (baseIs == null) { - throw new ValidationFailureException("No schematron found for resource type: " + throw new InternalErrorException("No schematron found for resource type: " + theCtx.getFhirContext().getResourceDefinition(theCtx.getResource()).getBaseDefinition().getImplementingClass().getCanonicalName()); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/ValidationContext.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/ValidationContext.java index 6886000a8a7..24dae18e373 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/ValidationContext.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/ValidationContext.java @@ -23,16 +23,17 @@ package ca.uhn.fhir.validation; 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.dstu.resource.OperationOutcome; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; +import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; class ValidationContext { private final IEncoder myEncoder; private final FhirContext myFhirContext; - private OperationOutcome myOperationOutcome; + private BaseOperationOutcome myOperationOutcome; private final T myResource; private String myXmlEncodedResource; - +private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ValidationContext.class); private ValidationContext(FhirContext theContext, T theResource, IEncoder theEncoder) { myFhirContext = theContext; myResource = theResource; @@ -43,9 +44,14 @@ class ValidationContext { return myFhirContext; } - public OperationOutcome getOperationOutcome() { + public BaseOperationOutcome getOperationOutcome() { if (myOperationOutcome == null) { - myOperationOutcome = new OperationOutcome(); + try { + myOperationOutcome = (BaseOperationOutcome) myFhirContext.getResourceDefinition("OperationOutcome").getImplementingClass().newInstance(); + } catch (Exception e1) { + ourLog.error("Failed to instantiate OperationOutcome resource instance", e1); + throw new InternalErrorException("Failed to instantiate OperationOutcome resource instance", e1); + } } return myOperationOutcome; } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/ValidationFailureException.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/ValidationFailureException.java index 1035a8939e3..30b5ebfa3a1 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/ValidationFailureException.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/ValidationFailureException.java @@ -20,42 +20,41 @@ package ca.uhn.fhir.validation; * #L% */ -import ca.uhn.fhir.model.dstu.resource.OperationOutcome; -import ca.uhn.fhir.model.dstu.valueset.IssueSeverityEnum; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; public class ValidationFailureException extends RuntimeException { private static final long serialVersionUID = 1L; - private OperationOutcome myOperationOutcome; + private BaseOperationOutcome myOperationOutcome; - public ValidationFailureException(String theProblem) { - this(theProblem, IssueSeverityEnum.FATAL, null); - } +// public ValidationFailureException(String theProblem) { +// this(theProblem, IssueSeverityEnum.FATAL, null); +// } - private static String toDescription(OperationOutcome theOo) { + private static String toDescription(BaseOperationOutcome theOo) { StringBuilder b = new StringBuilder(); - b.append(theOo.getIssueFirstRep().getDetails().getValue()); - b.append(" - "); - b.append(theOo.getIssueFirstRep().getLocationFirstRep().getValue()); + b.append(theOo.getIssueFirstRep().getDetailsElement().getValue()); +// b.append(" - "); +// b.append(theOo.getIssueFirstRep().getLocationFirstRep().getValue()); return b.toString(); } - public ValidationFailureException(String theProblem, Exception theCause) { - this(theProblem, IssueSeverityEnum.FATAL, theCause); - } +// public ValidationFailureException(String theProblem, Exception theCause) { +// this(theProblem, IssueSeverityEnum.FATAL, theCause); +// } - public ValidationFailureException(String theProblem, IssueSeverityEnum theSeverity, Exception theCause) { - super(theProblem, theCause); - myOperationOutcome = new OperationOutcome(); - myOperationOutcome.addIssue().setSeverity(theSeverity).setDetails(theProblem); - } +// public ValidationFailureException(String theProblem, IssueSeverityEnum theSeverity, Exception theCause) { +// super(theProblem, theCause); +// myOperationOutcome = new OperationOutcome(); +// myOperationOutcome.addIssue().setSeverity(theSeverity).setDetails(theProblem); +// } - public ValidationFailureException(OperationOutcome theOperationOutcome) { + public ValidationFailureException(BaseOperationOutcome theOperationOutcome) { super(toDescription(theOperationOutcome)); myOperationOutcome = theOperationOutcome; } - public OperationOutcome getOperationOutcome() { + public BaseOperationOutcome getOperationOutcome() { return myOperationOutcome; } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/ValidationResult.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/ValidationResult.java index f2d388f6bff..e8d693a4a61 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/ValidationResult.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/ValidationResult.java @@ -20,7 +20,7 @@ package ca.uhn.fhir.validation; * #L% */ -import ca.uhn.fhir.model.dstu.resource.OperationOutcome; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; /** * Encapsulates the results of validation @@ -29,17 +29,17 @@ import ca.uhn.fhir.model.dstu.resource.OperationOutcome; * @since 0.7 */ public class ValidationResult { - private OperationOutcome myOperationOutcome; + private BaseOperationOutcome myOperationOutcome; - private ValidationResult(OperationOutcome myOperationOutcome) { + private ValidationResult(BaseOperationOutcome myOperationOutcome) { this.myOperationOutcome = myOperationOutcome; } - public static ValidationResult valueOf(OperationOutcome myOperationOutcome) { + public static ValidationResult valueOf(BaseOperationOutcome myOperationOutcome) { return new ValidationResult(myOperationOutcome); } - public OperationOutcome getOperationOutcome() { + public BaseOperationOutcome getOperationOutcome() { return myOperationOutcome; } @@ -54,8 +54,8 @@ public class ValidationResult { private String toDescription() { StringBuilder b = new StringBuilder(100); if (myOperationOutcome != null) { - OperationOutcome.Issue issueFirstRep = myOperationOutcome.getIssueFirstRep(); - b.append(issueFirstRep.getDetails().getValue()); + BaseOperationOutcome.BaseIssue issueFirstRep = myOperationOutcome.getIssueFirstRep(); + b.append(issueFirstRep.getDetailsElement().getValue()); b.append(" - "); b.append(issueFirstRep.getLocationFirstRep().getValue()); } diff --git a/hapi-fhir-base/src/site/xdoc/doc_tinder.xml b/hapi-fhir-base/src/site/xdoc/doc_tinder.xml.vm similarity index 81% rename from hapi-fhir-base/src/site/xdoc/doc_tinder.xml rename to hapi-fhir-base/src/site/xdoc/doc_tinder.xml.vm index 39dd068f23c..00122fdf523 100644 --- a/hapi-fhir-base/src/site/xdoc/doc_tinder.xml +++ b/hapi-fhir-base/src/site/xdoc/doc_tinder.xml.vm @@ -34,12 +34,18 @@ builds a client for the Health Intersections reference server.

+ +

+ Note that as of HAPI 0.8, you need to add a dependency to the + plugin containing the version of FHIR you are building custom + structures against. +

ca.uhn.hapi.fhir hapi-tinder-plugin - 1.0-SNAPSHOT + ${project.version} generate-structures @@ -50,6 +56,13 @@ + + + ca.uhn.hapi.fhir + hapi-fhir-structures-dstu + ${project.version} + + ]]> diff --git a/hapi-fhir-base/src/site/xdoc/doc_upgrading.xml b/hapi-fhir-base/src/site/xdoc/doc_upgrading.xml index 84ab9aeb976..7481a2dcf24 100644 --- a/hapi-fhir-base/src/site/xdoc/doc_upgrading.xml +++ b/hapi-fhir-base/src/site/xdoc/doc_upgrading.xml @@ -8,11 +8,27 @@ -
- +
+ + + +

+ If you are using the "Tinder" Maven plugin to generate structure code, + you will need to add a structure dependency to the plugin configuration + itself in your project pom.xml. See the + Tinder Page for an example of + how to do this. +

+ +
+
+ +
+ +

As the HAPI FHIR API begins to mature, a number of minor changes to the way the library works have been introduced. Mostly these changes are made in order to make a consistent API across functions. diff --git a/hapi-fhir-base/src/test/resources/.keep b/hapi-fhir-base/src/test/resources/.keep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/hapi-fhir-base/testmindeps/pom.xml b/hapi-fhir-base/testmindeps/pom.xml index 4c8c3bd3042..114863ed25f 100644 --- a/hapi-fhir-base/testmindeps/pom.xml +++ b/hapi-fhir-base/testmindeps/pom.xml @@ -42,7 +42,11 @@ hapi-fhir-base 0.8-SNAPSHOT - + + ca.uhn.hapi.fhir + hapi-fhir-structures-dstu + 0.8-SNAPSHOT + diff --git a/hapi-fhir-base/testmindeps/pom.xml.orig b/hapi-fhir-base/testmindeps/pom.xml.orig new file mode 100644 index 00000000000..ae01d279cb5 --- /dev/null +++ b/hapi-fhir-base/testmindeps/pom.xml.orig @@ -0,0 +1,68 @@ + + 4.0.0 + + + ca.uhn.hapi.fhir + hapi-fhir + 0.8-SNAPSHOT + ../../pom.xml + + + hapi-fhir-base-testmindeps + jar + + HAPI FHIR - Minimal Dependency Test + + + + jetty + servlet-api + 2.5-6.0.2 + provided + + + junit + junit + ${junit_version} + + + org.mortbay.jetty + jetty + 6.1.26 + + + org.slf4j + slf4j-simple + 1.7.7 + + + + ca.uhn.hapi.fhir + hapi-fhir-base + 0.8-SNAPSHOT +<<<<<<< HEAD +======= + + + ca.uhn.hapi.fhir + hapi-fhir-structures-dstu + 0.8-SNAPSHOT +>>>>>>> versions + + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + true + + + + + + diff --git a/hapi-fhir-jpaserver-base/pom.xml b/hapi-fhir-jpaserver-base/pom.xml index eb780fbf28a..7442a17e01e 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.8-SNAPSHOT + + org.slf4j jcl-over-slf4j diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/JpaResourceProvider.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/JpaResourceProvider.java index f06f0635026..3c415cb4c5d 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/JpaResourceProvider.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/JpaResourceProvider.java @@ -11,6 +11,7 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.jpa.dao.IFhirResourceDao; import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.api.TagList; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome.BaseIssue; import ca.uhn.fhir.model.dstu.resource.OperationOutcome; import ca.uhn.fhir.model.dstu.valueset.IssueSeverityEnum; import ca.uhn.fhir.model.primitive.IdDt; @@ -160,7 +161,9 @@ public class JpaResourceProvider extends BaseJpaProvider im try { MethodOutcome retVal = new MethodOutcome(); retVal.setOperationOutcome(new OperationOutcome()); - retVal.getOperationOutcome().addIssue().setSeverity(IssueSeverityEnum.INFORMATION).setDetails("Resource validates successfully"); + BaseIssue issue = retVal.getOperationOutcome().addIssue(); + issue.getSeverityElement().setValue("information"); + issue.setDetails("Resource validates successfully"); return retVal; } finally { endRequest(theRequest); diff --git a/hapi-fhir-jpaserver-test/pom.xml b/hapi-fhir-jpaserver-test/pom.xml index 202b056b930..2450610c9d1 100644 --- a/hapi-fhir-jpaserver-test/pom.xml +++ b/hapi-fhir-jpaserver-test/pom.xml @@ -152,6 +152,13 @@ + + + ca.uhn.hapi.fhir + hapi-fhir-structures-dstu + 0.8-SNAPSHOT + + org.apache.maven.plugins 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..0a683f4735f 100644 --- a/hapi-fhir-jpaserver-uhnfhirtest/.settings/org.eclipse.wst.common.component +++ b/hapi-fhir-jpaserver-uhnfhirtest/.settings/org.eclipse.wst.common.component @@ -6,13 +6,16 @@ - + uses - + uses - + + uses + + consumes diff --git a/hapi-fhir-jpaserver-uhnfhirtest/pom.xml b/hapi-fhir-jpaserver-uhnfhirtest/pom.xml index 4e24ce771df..ea4f87258d9 100644 --- a/hapi-fhir-jpaserver-uhnfhirtest/pom.xml +++ b/hapi-fhir-jpaserver-uhnfhirtest/pom.xml @@ -18,6 +18,11 @@ hapi-fhir-jpaserver-base 0.8-SNAPSHOT + + ca.uhn.hapi.fhir + hapi-fhir-structures-dstu + 0.8-SNAPSHOT + ca.uhn.hapi.fhir hapi-fhir-testpage-overlay @@ -193,6 +198,7 @@ generate-jparest-server + dstu ca.uhn.test.jpasrv adversereaction @@ -202,7 +208,6 @@ appointment availability careplan - claim composition conceptmap condition @@ -256,7 +261,6 @@ specimen substance supply - user valueset @@ -266,6 +270,13 @@ + + + ca.uhn.hapi.fhir + hapi-fhir-structures-dstu + 0.8-SNAPSHOT + + org.apache.maven.plugins diff --git a/hapi-fhir-jpaserver-uhnfhirtest/pom.xml.orig b/hapi-fhir-jpaserver-uhnfhirtest/pom.xml.orig new file mode 100644 index 00000000000..0418223e7d4 --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/pom.xml.orig @@ -0,0 +1,308 @@ + + 4.0.0 + + + ca.uhn.hapi.fhir + hapi-fhir + 0.8-SNAPSHOT + ../pom.xml + + + hapi-fhir-jpaserver-uhnfhirtest + + HAPI FHIR - fhirtest.uhn.ca Deployable WAR + + + + ca.uhn.hapi.fhir + hapi-fhir-jpaserver-base + 0.8-SNAPSHOT +<<<<<<< HEAD +======= + + + ca.uhn.hapi.fhir + hapi-fhir-structures-dstu + 0.8-SNAPSHOT +>>>>>>> versions + + + ca.uhn.hapi.fhir + hapi-fhir-testpage-overlay + 0.8-SNAPSHOT + war + provided + + + + ca.uhn.hapi.fhir + hapi-fhir-jpaserver-test + 0.8-SNAPSHOT + test + + + + org.springframework + spring-web + ${spring_version} + + + + org.hsqldb + hsqldb + 2.3.2 + provided + + + + org.apache.derby + derby + ${derby_version} + + + org.apache.derby + derbynet + ${derby_version} + + + org.apache.derby + derbyclient + ${derby_version} + + + + org.thymeleaf + thymeleaf + ${thymeleaf-version} + + + ch.qos.logback + logback-classic + ${logback_version} + + + org.slf4j + jcl-over-slf4j + ${slf4j_version} + + + org.slf4j + slf4j-api + ${slf4j_version} + + + + com.google.guava + guava + 17.0 + + + + javax.servlet + javax.servlet-api + 3.1.0 + provided + + + + + org.eclipse.jetty + jetty-servlets + ${jetty_version} + test + + + org.eclipse.jetty + jetty-webapp + ${jetty_version} + test + + + org.eclipse.jetty + jetty-servlet + ${jetty_version} + test + + + org.eclipse.jetty + jetty-server + ${jetty_version} + test + + + org.eclipse.jetty + jetty-util + ${jetty_version} + test + + + + commons-dbcp + commons-dbcp + 1.4 + + + + + org.ebaysf.web + cors-filter + ${ebay_cors_filter_version} + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.7 + 1.7 + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + + + [0.4,) + + + + + + + + + + + + + + + + + ca.uhn.hapi.fhir + hapi-tinder-plugin + 0.8-SNAPSHOT + + + buildclient + + generate-jparest-server + + + dstu + ca.uhn.test.jpasrv + + adversereaction + alert + allergyintolerance + appointmentresponse + appointment + availability + careplan + composition + conceptmap + condition + conformance + coverage + deviceobservationreport + device + diagnosticorder + diagnosticreport + documentmanifest + documentreference + encounter + familyhistory + geneexpression + geneticanalysis + group + gvfmeta + gvfvariant + imagingstudy + immunizationrecommendation + immunization + list + location + media + medicationadministration + medicationdispense + medicationprescription + medication + medicationstatement + messageheader + microarray + observation + operationoutcome + orderresponse + order + organization + other + patient + practitioner + procedure + profile + provenance + query + questionnaire + relatedperson + remittance + securityevent + sequencinganalysis + sequencinglab + slot + specimen + substance + supply + user + valueset + + true + ${project.build.directory}/hapi-fhir-jpaserver/WEB-INF + hapi-fhir-server-resourceproviders.xml + + + + + + ca.uhn.hapi.fhir + hapi-fhir-structures-dstu + 0.8-SNAPSHOT + + + + + org.apache.maven.plugins + maven-war-plugin + + + + ca.uhn.hapi.fhir + hapi-fhir-testpage-overlay + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + true + + + + hapi-fhir-jpaserver + + + war + diff --git a/hapi-fhir-oauth2/pom.xml b/hapi-fhir-oauth2/pom.xml index a7dafb19e0c..b8f182797ab 100644 --- a/hapi-fhir-oauth2/pom.xml +++ b/hapi-fhir-oauth2/pom.xml @@ -19,7 +19,13 @@ hapi-fhir-base 0.8-SNAPSHOT - + + ca.uhn.hapi.fhir + hapi-fhir-structures-dstu + 0.8-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-dev/.classpath b/hapi-fhir-structures-dev/.classpath new file mode 100644 index 00000000000..f3e655204ba --- /dev/null +++ b/hapi-fhir-structures-dev/.classpath @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hapi-fhir-structures-dev/.gitignore b/hapi-fhir-structures-dev/.gitignore new file mode 100644 index 00000000000..b83d22266ac --- /dev/null +++ b/hapi-fhir-structures-dev/.gitignore @@ -0,0 +1 @@ +/target/ diff --git a/hapi-fhir-structures-dev/.settings/org.eclipse.core.resources.prefs b/hapi-fhir-structures-dev/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000000..f9fe34593fc --- /dev/null +++ b/hapi-fhir-structures-dev/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 +encoding/=UTF-8 diff --git a/hapi-fhir-structures-dev/.settings/org.eclipse.jdt.core.prefs b/hapi-fhir-structures-dev/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..60105c1b951 --- /dev/null +++ b/hapi-fhir-structures-dev/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/hapi-fhir-structures-dev/.settings/org.eclipse.m2e.core.prefs b/hapi-fhir-structures-dev/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 00000000000..f897a7f1cb2 --- /dev/null +++ b/hapi-fhir-structures-dev/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/hapi-fhir-structures-dev/pom.xml b/hapi-fhir-structures-dev/pom.xml new file mode 100644 index 00000000000..bfa3a451ce5 --- /dev/null +++ b/hapi-fhir-structures-dev/pom.xml @@ -0,0 +1,354 @@ + + 4.0.0 + + + ca.uhn.hapi.fhir + hapi-deployable-pom + 0.8-SNAPSHOT + ../hapi-deployable-pom/pom.xml + + + hapi-fhir-structures-dev + jar + + HAPI FHIR Structures - DEV (FHIR Latest) + + + + ca.uhn.hapi.fhir + hapi-fhir-base + 0.8-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 + + + org.thymeleaf + thymeleaf + ${thymeleaf-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 + + + + + + + + + ca.uhn.hapi.fhir + hapi-tinder-plugin + 0.8-SNAPSHOT + + + + generate-structures + + + + + ca.uhn.fhir.model.dev + dev + + account + adversereaction + adversereactionrisk + alert + allergyintolerance + appointment + appointmentresponse + availability + careplan + + composition + conceptmap + condition + conformance + contract + contraindication + coverage + device + deviceobservationreport + diagnosticorder + diagnosticreport + documentmanifest + documentreference + encounter + familyhistory + geneexpression + geneticanalysis + group + imagingstudy + immunization + immunizationrecommendation + list + location + media + medication + medicationadministration + medicationdispense + medicationprescription + medicationstatement + messageheader + microarray + namespace + nutritionorder + observation + operationdefinition + operationoutcome + order + orderresponse + organization + other + patient + + practitioner + procedure + profile + + provenance + query + questionnaire + questionnaireanswers + referralrequest + relatedperson + remittance + riskassessment + securityclaim + securityevent + securitygroup + securityprincipal + + sequencinganalysis + sequencinglab + slot + specimen + subscription + substance + supply + user + valueset + + true + + + + org.apache.maven.plugins + maven-deploy-plugin + + true + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + ca.uhn.hapi.fhir + hapi-tinder-plugin + [0.4-SNAPSHOT,) + + generate-structures + + + + + + + + + + + + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${maven_javadoc_plugin_version} + + + + + + + diff --git a/hapi-fhir-structures-dev/pom.xml.versionsBackup b/hapi-fhir-structures-dev/pom.xml.versionsBackup new file mode 100644 index 00000000000..a130f34c7db --- /dev/null +++ b/hapi-fhir-structures-dev/pom.xml.versionsBackup @@ -0,0 +1,352 @@ + + 4.0.0 + + + ca.uhn.hapi.fhir + hapi-fhir + 0.7-SNAPSHOT + ../pom.xml + + + hapi-fhir-structures-dev + jar + + HAPI FHIR Structures - DEV (FHIR Latest) + + + + ca.uhn.hapi.fhir + 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 + + + org.thymeleaf + thymeleaf + ${thymeleaf-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 + + + + + + + + + ca.uhn.hapi.fhir + hapi-tinder-plugin + 0.7-SNAPSHOT + + + + generate-structures + + + + + ca.uhn.fhir.model.dev + dev + + account + adversereaction + adversereactionrisk + alert + allergyintolerance + appointment + appointmentresponse + availability + careplan + + composition + conceptmap + condition + conformance + contract + contraindication + coverage + device + deviceobservationreport + diagnosticorder + diagnosticreport + documentmanifest + documentreference + encounter + familyhistory + geneexpression + geneticanalysis + group + imagingstudy + immunization + immunizationrecommendation + list + location + media + medication + medicationadministration + medicationdispense + medicationprescription + medicationstatement + messageheader + microarray + namespace + nutritionorder + observation + operationdefinition + operationoutcome + order + orderresponse + organization + other + patient + person + practitioner + procedure + profile + + provenance + query + questionnaire + questionnaireanswers + referralrequest + relatedperson + remittance + riskassessment + securityclaim + securityevent + securitygroup + securityprincipal + + sequencinganalysis + sequencinglab + slot + specimen + subscription + substance + supply + user + valueset + + true + + + + org.apache.maven.plugins + maven-deploy-plugin + + true + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + ca.uhn.hapi.fhir + hapi-tinder-plugin + [0.4-SNAPSHOT,) + + generate-structures + + + + + + + + + + + + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${maven_javadoc_plugin_version} + + + + + + + diff --git a/hapi-fhir-structures-dev/src/main/java/ca/uhn/fhir/model/dev/composite/AgeDt.java b/hapi-fhir-structures-dev/src/main/java/ca/uhn/fhir/model/dev/composite/AgeDt.java new file mode 100644 index 00000000000..8cddc638ad5 --- /dev/null +++ b/hapi-fhir-structures-dev/src/main/java/ca/uhn/fhir/model/dev/composite/AgeDt.java @@ -0,0 +1,25 @@ +package ca.uhn.fhir.model.dev.composite; + +/* + * #%L + * HAPI FHIR Structures - DEV (FHIR Latest) + * %% + * 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% + */ + +public class AgeDt extends QuantityDt { + +} diff --git a/hapi-fhir-structures-dev/src/main/java/ca/uhn/fhir/model/dev/composite/BoundCodeableConceptDt.java b/hapi-fhir-structures-dev/src/main/java/ca/uhn/fhir/model/dev/composite/BoundCodeableConceptDt.java new file mode 100644 index 00000000000..0e8b505fd54 --- /dev/null +++ b/hapi-fhir-structures-dev/src/main/java/ca/uhn/fhir/model/dev/composite/BoundCodeableConceptDt.java @@ -0,0 +1,123 @@ +package ca.uhn.fhir.model.dev.composite; + +/* + * #%L + * HAPI FHIR Structures - DEV (FHIR Latest) + * %% + * 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.defaultString; + +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; + +import ca.uhn.fhir.model.api.IBoundCodeableConcept; +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 implements IBoundCodeableConcept { + + 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.getCodeElement().getValue()), defaultString(next.getSystemElement().getValueAsString())); + if (nextT != null) { + retVal.add(nextT); + } else { + // TODO: throw special exception type? + } + } + return retVal; + } + +} diff --git a/hapi-fhir-structures-dev/src/main/java/ca/uhn/fhir/model/dev/composite/CountDt.java b/hapi-fhir-structures-dev/src/main/java/ca/uhn/fhir/model/dev/composite/CountDt.java new file mode 100644 index 00000000000..878c35de5e1 --- /dev/null +++ b/hapi-fhir-structures-dev/src/main/java/ca/uhn/fhir/model/dev/composite/CountDt.java @@ -0,0 +1,25 @@ +package ca.uhn.fhir.model.dev.composite; + +/* + * #%L + * HAPI FHIR Structures - DEV (FHIR Latest) + * %% + * 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% + */ + +public class CountDt extends QuantityDt { + +} diff --git a/hapi-fhir-structures-dev/src/main/java/ca/uhn/fhir/model/dev/composite/DistanceDt.java b/hapi-fhir-structures-dev/src/main/java/ca/uhn/fhir/model/dev/composite/DistanceDt.java new file mode 100644 index 00000000000..51afb6e26ef --- /dev/null +++ b/hapi-fhir-structures-dev/src/main/java/ca/uhn/fhir/model/dev/composite/DistanceDt.java @@ -0,0 +1,25 @@ +package ca.uhn.fhir.model.dev.composite; + +/* + * #%L + * HAPI FHIR Structures - DEV (FHIR Latest) + * %% + * 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% + */ + +public class DistanceDt extends QuantityDt { + +} diff --git a/hapi-fhir-structures-dev/src/main/java/ca/uhn/fhir/model/dev/composite/DurationDt.java b/hapi-fhir-structures-dev/src/main/java/ca/uhn/fhir/model/dev/composite/DurationDt.java new file mode 100644 index 00000000000..4a2dbd8997a --- /dev/null +++ b/hapi-fhir-structures-dev/src/main/java/ca/uhn/fhir/model/dev/composite/DurationDt.java @@ -0,0 +1,25 @@ +package ca.uhn.fhir.model.dev.composite; + +/* + * #%L + * HAPI FHIR Structures - DEV (FHIR Latest) + * %% + * 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% + */ + +public class DurationDt extends QuantityDt { + +} diff --git a/hapi-fhir-structures-dev/src/main/java/ca/uhn/fhir/model/dev/composite/MoneyDt.java b/hapi-fhir-structures-dev/src/main/java/ca/uhn/fhir/model/dev/composite/MoneyDt.java new file mode 100644 index 00000000000..9c9fbf9cf75 --- /dev/null +++ b/hapi-fhir-structures-dev/src/main/java/ca/uhn/fhir/model/dev/composite/MoneyDt.java @@ -0,0 +1,25 @@ +package ca.uhn.fhir.model.dev.composite; + +/* + * #%L + * HAPI FHIR Structures - DEV (FHIR Latest) + * %% + * 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% + */ + +public class MoneyDt extends QuantityDt { + +} diff --git a/hapi-fhir-structures-dev/src/main/java/ca/uhn/fhir/model/dstu/FhirDev.java b/hapi-fhir-structures-dev/src/main/java/ca/uhn/fhir/model/dstu/FhirDev.java new file mode 100644 index 00000000000..befc2083bb6 --- /dev/null +++ b/hapi-fhir-structures-dev/src/main/java/ca/uhn/fhir/model/dstu/FhirDev.java @@ -0,0 +1,64 @@ +package ca.uhn.fhir.model.dstu; + +/* + * #%L + * HAPI FHIR Structures - DEV (FHIR Latest) + * %% + * 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 org.apache.commons.lang3.StringUtils; + +import ca.uhn.fhir.context.RuntimeResourceDefinition; +import ca.uhn.fhir.model.api.IFhirVersion; +import ca.uhn.fhir.model.api.IResource; +import ca.uhn.fhir.model.dev.resource.Profile; +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 FhirDev implements IFhirVersion { + + private String myId; + + @Override + public Object createServerConformanceProvider(RestfulServer theServer) { + return new ServerConformanceProvider(theServer); + } + + @Override + public IResource generateProfile(RuntimeResourceDefinition theRuntimeResourceDefinition) { + Profile retVal = new Profile(); + + RuntimeResourceDefinition def = theRuntimeResourceDefinition; + + myId = def.getId(); + if (StringUtils.isBlank(myId)) { + myId = theRuntimeResourceDefinition.getName().toLowerCase(); + } + + retVal.setId(new IdDt(myId)); + return retVal; + } + + @Override + public IResourceProvider createServerProfilesProvider(RestfulServer theRestfulServer) { + return new ServerProfileProvider(theRestfulServer.getFhirContext()); + } + +} diff --git a/hapi-fhir-structures-dev/src/main/java/ca/uhn/fhir/rest/server/provider/ServerConformanceProvider.java b/hapi-fhir-structures-dev/src/main/java/ca/uhn/fhir/rest/server/provider/ServerConformanceProvider.java new file mode 100644 index 00000000000..3f7cb999c7a --- /dev/null +++ b/hapi-fhir-structures-dev/src/main/java/ca/uhn/fhir/rest/server/provider/ServerConformanceProvider.java @@ -0,0 +1,359 @@ +package ca.uhn.fhir.rest.server.provider; + +/* + * #%L + * HAPI FHIR Structures - DEV (FHIR Latest) + * %% + * 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.Collections; +import java.util.Comparator; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +import org.apache.commons.lang3.StringUtils; + +import ca.uhn.fhir.context.RuntimeResourceDefinition; +import ca.uhn.fhir.context.RuntimeSearchParam; +import ca.uhn.fhir.model.api.IResource; +import ca.uhn.fhir.model.dev.resource.Conformance; +import ca.uhn.fhir.model.dev.resource.OperationDefinition; +import ca.uhn.fhir.model.dev.resource.Conformance.Rest; +import ca.uhn.fhir.model.dev.resource.Conformance.RestOperation; +import ca.uhn.fhir.model.dev.resource.Conformance.RestResource; +import ca.uhn.fhir.model.dev.resource.Conformance.RestResourceSearchParam; +import ca.uhn.fhir.model.dev.resource.OperationDefinition.Parameter; +import ca.uhn.fhir.model.dev.valueset.RestfulConformanceModeEnum; +import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; +import ca.uhn.fhir.model.primitive.BooleanDt; +import ca.uhn.fhir.model.primitive.CodeDt; +import ca.uhn.fhir.model.primitive.DateTimeDt; +import ca.uhn.fhir.model.primitive.IdDt; +import ca.uhn.fhir.model.primitive.StringDt; +import ca.uhn.fhir.rest.annotation.Metadata; +import ca.uhn.fhir.rest.method.BaseMethodBinding; +import ca.uhn.fhir.rest.method.DynamicSearchMethodBinding; +import ca.uhn.fhir.rest.method.IParameter; +import ca.uhn.fhir.rest.method.SearchMethodBinding; +import ca.uhn.fhir.rest.method.SearchParameter; +import ca.uhn.fhir.rest.server.Constants; +import ca.uhn.fhir.rest.server.ResourceBinding; +import ca.uhn.fhir.rest.server.RestfulServer; +import ca.uhn.fhir.util.ExtensionConstants; + +/** + * Server FHIR Provider which serves the conformance statement for a RESTful server implementation + * + *

+ * Note: This class is safe to extend, but it is important to note that the same instance of {@link Conformance} is + * always returned unless {@link #setCache(boolean)} is called with a value of false. This means that if + * you are adding anything to the returned conformance instance on each call you should call + * setCache(false) in your provider constructor. + *

+ */ +public class ServerConformanceProvider { + + private boolean myCache = true; + private volatile Conformance myConformance; + private String myPublisher = "Not provided"; + private final RestfulServer myRestfulServer; + + public ServerConformanceProvider(RestfulServer theRestfulServer) { + myRestfulServer = theRestfulServer; + } + + /** + * Gets the value of the "publisher" that will be placed in the generated conformance statement. As this + * is a mandatory element, the value should not be null (although this is not enforced). The value defaults + * to "Not provided" but may be set to null, which will cause this element to be omitted. + */ + public String getPublisher() { + return myPublisher; + } + + /** + * Actually create and return the conformance statement + * + * See the class documentation for an important note if you are extending this class + */ + @Metadata + public Conformance getServerConformance() { + if (myConformance != null && myCache) { + return myConformance; + } + + Conformance retVal = new Conformance(); + + retVal.setPublisher(myPublisher); + retVal.setDate(DateTimeDt.withCurrentTime()); + retVal.setFhirVersion("0.80"); // TODO: pull from model + retVal.setAcceptUnknown(false); // TODO: make this configurable - this is a fairly big effort since the parser needs to be modified to actually allow it + + retVal.getImplementation().setDescription(myRestfulServer.getImplementationDescription()); + retVal.getSoftware().setName(myRestfulServer.getServerName()); + retVal.getSoftware().setVersion(myRestfulServer.getServerVersion()); + retVal.addFormat(Constants.CT_FHIR_XML); + retVal.addFormat(Constants.CT_FHIR_JSON); + + Rest rest = retVal.addRest(); + rest.setMode(RestfulConformanceModeEnum.SERVER); + +// Set systemOps = new HashSet(); +// +// List bindings = new ArrayList(myRestfulServer.getResourceBindings()); +// Collections.sort(bindings, new Comparator() { +// @Override +// public int compare(ResourceBinding theArg0, ResourceBinding theArg1) { +// return theArg0.getResourceName().compareToIgnoreCase(theArg1.getResourceName()); +// } +// }); +// +// for (ResourceBinding next : bindings) { +// +// Set resourceOps = new HashSet(); +// RestResource resource = rest.addResource(); +// +// String resourceName = next.getResourceName(); +// RuntimeResourceDefinition def = myRestfulServer.getFhirContext().getResourceDefinition(resourceName); +// resource.getType().setValue(def.getName()); +// resource.getProfile().setReference(new IdDt(def.getResourceProfile())); +// +// TreeSet includes = new TreeSet(); +// +// // Map nameToSearchParam = new HashMap(); +// for (BaseMethodBinding nextMethodBinding : next.getMethodBindings()) { +// RestfulOperationTypeEnum resOp = nextMethodBinding.getResourceOperationType(); +// if (resOp != null) { +// if (resourceOps.contains(resOp) == false) { +// resourceOps.add(resOp); +// resource.addOperation().setCode(resOp); +// } +// } +// +// RestfulOperationSystemEnum sysOp = nextMethodBinding.getSystemOperationType(); +// if (sysOp != null) { +// if (systemOps.contains(sysOp) == false) { +// systemOps.add(sysOp); +// rest.addOperation().setCode(sysOp); +// } +// } +// +// if (nextMethodBinding instanceof SearchMethodBinding) { +// handleSearchMethodBinding(rest, resource, resourceName, def, includes, (SearchMethodBinding) nextMethodBinding); +// } else if (nextMethodBinding instanceof DynamicSearchMethodBinding) { +// handleDynamicSearchMethodBinding(resource, def, includes, (DynamicSearchMethodBinding) nextMethodBinding); +// } +// +// Collections.sort(resource.getOperation(), new Comparator() { +// @Override +// public int compare(RestResourceOperation theO1, RestResourceOperation theO2) { +// RestfulOperationTypeEnum o1 = theO1.getCode().getValueAsEnum(); +// RestfulOperationTypeEnum o2 = theO2.getCode().getValueAsEnum(); +// if (o1 == null && o2 == null) { +// return 0; +// } +// if (o1 == null) { +// return 1; +// } +// if (o2 == null) { +// return -1; +// } +// return o1.ordinal() - o2.ordinal(); +// } +// }); +// +// } +// +// for (String nextInclude : includes) { +// resource.addSearchInclude(nextInclude); +// } +// +// } + + myConformance = retVal; + return retVal; + } + + private void handleDynamicSearchMethodBinding(RestResource resource, RuntimeResourceDefinition def, TreeSet includes, DynamicSearchMethodBinding searchMethodBinding) { + includes.addAll(searchMethodBinding.getIncludes()); + + List searchParameters = new ArrayList(); + searchParameters.addAll(searchMethodBinding.getSearchParams()); + sortRuntimeSearchParameters(searchParameters); + + if (!searchParameters.isEmpty()) { + + for (RuntimeSearchParam nextParameter : searchParameters) { + + String nextParamName = nextParameter.getName(); + + // String chain = null; + String nextParamUnchainedName = nextParamName; + if (nextParamName.contains(".")) { + // chain = nextParamName.substring(nextParamName.indexOf('.') + 1); + nextParamUnchainedName = nextParamName.substring(0, nextParamName.indexOf('.')); + } + + String nextParamDescription = nextParameter.getDescription(); + + /* + * If the parameter has no description, default to the one from the resource + */ + if (StringUtils.isBlank(nextParamDescription)) { + RuntimeSearchParam paramDef = def.getSearchParam(nextParamUnchainedName); + if (paramDef != null) { + nextParamDescription = paramDef.getDescription(); + } + } + + RestResourceSearchParam param; + param = resource.addSearchParam(); + + param.setName(nextParamName); + // if (StringUtils.isNotBlank(chain)) { + // param.addChain(chain); + // } + param.setDocumentation(nextParamDescription); +// param.setType(nextParameter.getParamType()); + } + } + } + + private void handleSearchMethodBinding(Rest rest, RestResource resource, String resourceName, RuntimeResourceDefinition def, TreeSet includes, SearchMethodBinding searchMethodBinding) { + includes.addAll(searchMethodBinding.getIncludes()); + + List params = searchMethodBinding.getParameters(); + List searchParameters = new ArrayList(); + for (IParameter nextParameter : params) { + if ((nextParameter instanceof SearchParameter)) { + searchParameters.add((SearchParameter) nextParameter); + } + } + sortSearchParameters(searchParameters); + if (!searchParameters.isEmpty()) { + boolean allOptional = searchParameters.get(0).isRequired() == false; + + OperationDefinition query = null; + if (!allOptional) { + RestOperation operation = rest.addOperation(); + query = new OperationDefinition(); + operation.setDefinition(new ResourceReferenceDt(query)); + query.getDescriptionElement().setValue(searchMethodBinding.getDescription()); + query.addUndeclaredExtension(false, ExtensionConstants.QUERY_RETURN_TYPE, new CodeDt(resourceName)); + for (String nextInclude : searchMethodBinding.getIncludes()) { + query.addUndeclaredExtension(false, ExtensionConstants.QUERY_ALLOWED_INCLUDE, new StringDt(nextInclude)); + } + } + + for (SearchParameter nextParameter : searchParameters) { + + String nextParamName = nextParameter.getName(); + + // String chain = null; + String nextParamUnchainedName = nextParamName; + if (nextParamName.contains(".")) { + // chain = nextParamName.substring(nextParamName.indexOf('.') + 1); + nextParamUnchainedName = nextParamName.substring(0, nextParamName.indexOf('.')); + } + + String nextParamDescription = nextParameter.getDescription(); + + /* + * If the parameter has no description, default to the one from the resource + */ + if (StringUtils.isBlank(nextParamDescription)) { + RuntimeSearchParam paramDef = def.getSearchParam(nextParamUnchainedName); + if (paramDef != null) { + nextParamDescription = paramDef.getDescription(); + } + } + + Parameter param; + if (query == null) { +// param = resource.addSearchParam(); + } else { + param = query.addParameter(); + param.addUndeclaredExtension(false, ExtensionConstants.PARAM_IS_REQUIRED, new BooleanDt(nextParameter.isRequired())); + } + +// param.setName(nextParamName); + // if (StringUtils.isNotBlank(chain)) { + // param.addChain(chain); + // } +// param.setDocumentation(nextParamDescription); +// param.setType(nextParameter.getParamType()); + for (Class nextTarget : nextParameter.getDeclaredTypes()) { + RuntimeResourceDefinition targetDef = myRestfulServer.getFhirContext().getResourceDefinition(nextTarget); + if (targetDef != null) { +// ResourceTypeEnum code = ResourceTypeEnum.VALUESET_BINDER.fromCodeString(targetDef.getName()); +// if (code != null) { +// param.addTarget(code); +// } + } + } + } + } + } + + /** + * Sets the cache property (default is true). If set to true, the same response will be returned for each + * invocation. + *

+ * See the class documentation for an important note if you are extending this class + *

+ */ + public void setCache(boolean theCache) { + myCache = theCache; + } + + /** + * Sets the value of the "publisher" that will be placed in the generated conformance statement. As this + * is a mandatory element, the value should not be null (although this is not enforced). The value defaults + * to "Not provided" but may be set to null, which will cause this element to be omitted. + */ + public void setPublisher(String thePublisher) { + myPublisher = thePublisher; + } + + private void sortRuntimeSearchParameters(List searchParameters) { + Collections.sort(searchParameters, new Comparator() { + @Override + public int compare(RuntimeSearchParam theO1, RuntimeSearchParam theO2) { + return theO1.getName().compareTo(theO2.getName()); + } + }); + } + + private void sortSearchParameters(List searchParameters) { + Collections.sort(searchParameters, new Comparator() { + @Override + public int compare(SearchParameter theO1, SearchParameter theO2) { + if (theO1.isRequired() == theO2.isRequired()) { + return theO1.getName().compareTo(theO2.getName()); + } + if (theO1.isRequired()) { + return -1; + } + return 1; + } + }); + } +} diff --git a/hapi-fhir-structures-dev/src/main/java/ca/uhn/fhir/rest/server/provider/ServerProfileProvider.java b/hapi-fhir-structures-dev/src/main/java/ca/uhn/fhir/rest/server/provider/ServerProfileProvider.java new file mode 100644 index 00000000000..b6199256b07 --- /dev/null +++ b/hapi-fhir-structures-dev/src/main/java/ca/uhn/fhir/rest/server/provider/ServerProfileProvider.java @@ -0,0 +1,79 @@ +package ca.uhn.fhir.rest.server.provider; + +/* + * #%L + * HAPI FHIR Structures - DEV (FHIR Latest) + * %% + * 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.Collections; +import java.util.Comparator; +import java.util.List; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.context.RuntimeResourceDefinition; +import ca.uhn.fhir.model.api.IResource; +import ca.uhn.fhir.model.dev.resource.Profile; +import ca.uhn.fhir.model.primitive.IdDt; +import ca.uhn.fhir.rest.annotation.IdParam; +import ca.uhn.fhir.rest.annotation.Read; +import ca.uhn.fhir.rest.annotation.Search; +import ca.uhn.fhir.rest.server.IResourceProvider; + +public class ServerProfileProvider implements IResourceProvider { + + private FhirContext myContext; + + public ServerProfileProvider(FhirContext theCtx) { + myContext = theCtx; + } + + @Override + public Class getResourceType() { + return Profile.class; + } + + @Read() + public Profile getProfileById(@IdParam IdDt theId) { + RuntimeResourceDefinition retVal = myContext.getResourceDefinitionById(theId.getValue()); + if (retVal==null) { + return null; + } + return (Profile) retVal.toProfile(); + } + + @Search() + public List getAllProfiles() { + List defs = new ArrayList(myContext.getResourceDefinitions()); + Collections.sort(defs, new Comparator() { + @Override + public int compare(RuntimeResourceDefinition theO1, RuntimeResourceDefinition theO2) { + int cmp = theO1.getName().compareTo(theO2.getName()); + if (cmp==0) { + cmp=theO1.getResourceProfile().compareTo(theO2.getResourceProfile()); + } + return cmp; + }}); + ArrayList retVal = new ArrayList(); + for (RuntimeResourceDefinition next : defs) { + retVal.add((Profile) next.toProfile()); + } + return retVal; + } + +} 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..fdbc05ba5de --- /dev/null +++ b/hapi-fhir-structures-dstu/.settings/org.eclipse.wst.common.component @@ -0,0 +1,3 @@ + + + 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 9051879724d..5a3d2f0c6d5 100644 --- a/hapi-fhir-structures-dstu/pom.xml +++ b/hapi-fhir-structures-dstu/pom.xml @@ -4,9 +4,9 @@ ca.uhn.hapi.fhir - hapi-fhir + hapi-deployable-pom 0.8-SNAPSHOT - ../pom.xml + ../hapi-deployable-pom/pom.xml hapi-fhir-structures-dstu @@ -20,6 +20,174 @@ hapi-fhir-base 0.8-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 + + + org.thymeleaf + thymeleaf + ${thymeleaf-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 + + + @@ -38,8 +206,6 @@ ca.uhn.fhir.model.dstu - - adversereaction alert allergyintolerance @@ -47,7 +213,7 @@ appointment availability careplan - claim + composition conceptmap condition @@ -60,7 +226,6 @@ documentmanifest documentreference encounter - familyhistory geneexpression geneticanalysis @@ -80,7 +245,6 @@ medicationstatement messageheader microarray - observation operationoutcome orderresponse @@ -88,34 +252,23 @@ organization other patient - practitioner procedure profile - - provenance query - questionnaire relatedperson remittance - securityevent - sequencinganalysis sequencinglab slot specimen substance supply - - test user - valueset - - true 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 new file mode 100644 index 00000000000..c1fba6f2312 --- /dev/null +++ b/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/model/dstu/FhirDstu1.java @@ -0,0 +1,333 @@ +package ca.uhn.fhir.model.dstu; + +/* + * #%L + * HAPI FHIR Structures - DSTU (FHIR 0.80) + * %% + * 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.isNotBlank; +import static org.apache.commons.lang3.StringUtils.join; + +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.text.WordUtils; + +import ca.uhn.fhir.context.BaseRuntimeChildDefinition; +import ca.uhn.fhir.context.BaseRuntimeDeclaredChildDefinition; +import ca.uhn.fhir.context.BaseRuntimeElementCompositeDefinition; +import ca.uhn.fhir.context.BaseRuntimeElementDefinition; +import ca.uhn.fhir.context.BaseRuntimeElementDefinition.ChildTypeEnum; +import ca.uhn.fhir.context.ConfigurationException; +import ca.uhn.fhir.context.RuntimeChildChoiceDefinition; +import ca.uhn.fhir.context.RuntimeChildCompositeDatatypeDefinition; +import ca.uhn.fhir.context.RuntimeChildContainedResources; +import ca.uhn.fhir.context.RuntimeChildDeclaredExtensionDefinition; +import ca.uhn.fhir.context.RuntimeChildPrimitiveDatatypeDefinition; +import ca.uhn.fhir.context.RuntimeChildResourceBlockDefinition; +import ca.uhn.fhir.context.RuntimeChildResourceDefinition; +import ca.uhn.fhir.context.RuntimeChildUndeclaredExtensionDefinition; +import ca.uhn.fhir.context.RuntimePrimitiveDatatypeDefinition; +import ca.uhn.fhir.context.RuntimeResourceBlockDefinition; +import ca.uhn.fhir.context.RuntimeResourceDefinition; +import ca.uhn.fhir.context.RuntimeResourceReferenceDefinition; +import ca.uhn.fhir.model.api.IFhirVersion; +import ca.uhn.fhir.model.api.IPrimitiveDatatype; +import ca.uhn.fhir.model.api.IResource; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.dstu.resource.Profile; +import ca.uhn.fhir.model.dstu.resource.Profile.ExtensionDefn; +import ca.uhn.fhir.model.dstu.resource.Profile.Structure; +import ca.uhn.fhir.model.dstu.resource.Profile.StructureElement; +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 { + + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirDstu1.class); + private Map myExtensionDefToCode = new HashMap(); + private String myId; + + @Override + public Object createServerConformanceProvider(RestfulServer theServer) { + return new ServerConformanceProvider(theServer); + } + + private void fillBasics(StructureElement theElement, BaseRuntimeElementDefinition def, LinkedList path, BaseRuntimeDeclaredChildDefinition theChild) { + if (path.isEmpty()) { + path.add(def.getName()); + theElement.setName(def.getName()); + } else { + path.add(WordUtils.uncapitalize(theChild.getElementName())); + theElement.setName(theChild.getElementName()); + } + theElement.setPath(StringUtils.join(path, '.')); + } + + private void fillExtensions(Structure theStruct, LinkedList path, List extList, String elementName, boolean theIsModifier) { + if (extList.size() > 0) { + StructureElement extSlice = theStruct.addElement(); + extSlice.setName(elementName); + extSlice.setPath(join(path, '.') + '.' + elementName); + extSlice.getSlicing().getDiscriminator().setValue("url"); + extSlice.getSlicing().setOrdered(false); + extSlice.getSlicing().setRules(SlicingRulesEnum.OPEN); + extSlice.getDefinition().addType().setCode(DataTypeEnum.EXTENSION); + + for (RuntimeChildDeclaredExtensionDefinition nextExt : extList) { + StructureElement nextProfileExt = theStruct.addElement(); + nextProfileExt.getDefinition().setIsModifier(theIsModifier); + nextProfileExt.setName(extSlice.getName()); + nextProfileExt.setPath(extSlice.getPath()); + fillMinAndMaxAndDefinitions(nextExt, nextProfileExt); + StructureElementDefinitionType type = nextProfileExt.getDefinition().addType(); + type.setCode(DataTypeEnum.EXTENSION); + if (nextExt.isDefinedLocally()) { + type.setProfile(nextExt.getExtensionUrl().substring(nextExt.getExtensionUrl().indexOf('#'))); + } else { + type.setProfile(nextExt.getExtensionUrl()); + } + } + } else { + StructureElement extSlice = theStruct.addElement(); + extSlice.setName(elementName); + extSlice.setPath(join(path, '.') + '.' + elementName); + extSlice.getDefinition().setIsModifier(theIsModifier); + extSlice.getDefinition().addType().setCode(DataTypeEnum.EXTENSION); + extSlice.getDefinition().setMin(0); + extSlice.getDefinition().setMax("*"); + } + } + + private void fillMinAndMaxAndDefinitions(BaseRuntimeDeclaredChildDefinition child, StructureElement elem) { + elem.getDefinition().setMin(child.getMin()); + if (child.getMax() == Child.MAX_UNLIMITED) { + elem.getDefinition().setMax("*"); + } else { + elem.getDefinition().setMax(Integer.toString(child.getMax())); + } + + if (isNotBlank(child.getShortDefinition())) { + elem.getDefinition().getShort().setValue(child.getShortDefinition()); + } + if (isNotBlank(child.getFormalDefinition())) { + elem.getDefinition().getFormal().setValue(child.getFormalDefinition()); + } + } + + private void fillName(StructureElement elem, BaseRuntimeElementDefinition nextDef) { + if (nextDef instanceof RuntimeResourceReferenceDefinition) { + RuntimeResourceReferenceDefinition rr = (RuntimeResourceReferenceDefinition) nextDef; + for (Class next : rr.getResourceTypes()) { + StructureElementDefinitionType type = elem.getDefinition().addType(); + type.getCode().setValue("ResourceReference"); + + if (next != IResource.class) { + RuntimeResourceDefinition resDef = rr.getDefinitionForResourceType(next); + type.getProfile().setValueAsString(resDef.getResourceProfile()); + } + } + + return; + } + + StructureElementDefinitionType type = elem.getDefinition().addType(); + String name = nextDef.getName(); + DataTypeEnum fromCodeString = DataTypeEnum.VALUESET_BINDER.fromCodeString(name); + if (fromCodeString == null) { + throw new ConfigurationException("Unknown type: " + name); + } + type.setCode(fromCodeString); + } + + private void fillProfile(Structure theStruct, StructureElement theElement, BaseRuntimeElementDefinition def, LinkedList path, BaseRuntimeDeclaredChildDefinition theChild) { + + fillBasics(theElement, def, path, theChild); + + String expectedPath = StringUtils.join(path, '.'); + + ourLog.info("Filling profile for: {} - Path: {}", expectedPath); + String name = def.getName(); + if (!expectedPath.equals(name)) { + path.pollLast(); + theElement.getDefinition().getNameReference().setValue(def.getName()); + return; + } + + fillExtensions(theStruct, path, def.getExtensionsNonModifier(), "extension", false); + fillExtensions(theStruct, path, def.getExtensionsModifier(), "modifierExtension", true); + + if (def.getChildType() == ChildTypeEnum.RESOURCE) { + StructureElement narrative = theStruct.addElement(); + narrative.setName("text"); + narrative.setPath(join(path, '.') + ".text"); + narrative.getDefinition().addType().setCode(DataTypeEnum.NARRATIVE); + narrative.getDefinition().setIsModifier(false); + narrative.getDefinition().setMin(0); + narrative.getDefinition().setMax("1"); + + StructureElement contained = theStruct.addElement(); + contained.setName("contained"); + contained.setPath(join(path, '.') + ".contained"); + contained.getDefinition().addType().getCode().setValue("Resource"); + contained.getDefinition().setIsModifier(false); + contained.getDefinition().setMin(0); + contained.getDefinition().setMax("1"); + } + + if (def instanceof BaseRuntimeElementCompositeDefinition) { + BaseRuntimeElementCompositeDefinition cdef = ((BaseRuntimeElementCompositeDefinition) def); + for (BaseRuntimeChildDefinition nextChild : cdef.getChildren()) { + if (nextChild instanceof RuntimeChildUndeclaredExtensionDefinition) { + continue; + } + + BaseRuntimeDeclaredChildDefinition child = (BaseRuntimeDeclaredChildDefinition) nextChild; + StructureElement elem = theStruct.addElement(); + fillMinAndMaxAndDefinitions(child, elem); + + if (child instanceof RuntimeChildResourceBlockDefinition) { + RuntimeResourceBlockDefinition nextDef = (RuntimeResourceBlockDefinition) child.getSingleChildOrThrow(); + fillProfile(theStruct, elem, nextDef, path, child); + } else if (child instanceof RuntimeChildContainedResources) { + // ignore + } else if (child instanceof RuntimeChildDeclaredExtensionDefinition) { + throw new IllegalStateException("Unexpected child type: " + child.getClass().getCanonicalName()); + } else if (child instanceof RuntimeChildCompositeDatatypeDefinition || child instanceof RuntimeChildPrimitiveDatatypeDefinition || child instanceof RuntimeChildChoiceDefinition + || child instanceof RuntimeChildResourceDefinition) { + Iterator childNamesIter = child.getValidChildNames().iterator(); + String nextName = childNamesIter.next(); + BaseRuntimeElementDefinition nextDef = child.getChildByName(nextName); + fillBasics(elem, nextDef, path, child); + fillName(elem, nextDef); + while (childNamesIter.hasNext()) { + nextDef = child.getChildByName(childNamesIter.next()); + fillName(elem, nextDef); + } + path.pollLast(); + } else { + throw new IllegalStateException("Unexpected child type: " + child.getClass().getCanonicalName()); + } + + } + } else { + throw new IllegalStateException("Unexpected child type: " + def.getClass().getCanonicalName()); + } + + path.pollLast(); + } + + @Override + public IResource generateProfile(RuntimeResourceDefinition theRuntimeResourceDefinition) { + Profile retVal = new Profile(); + + RuntimeResourceDefinition def = theRuntimeResourceDefinition; + + myId = def.getId(); + if (StringUtils.isBlank(myId)) { + myId = theRuntimeResourceDefinition.getName().toLowerCase(); + } + + retVal.setId(new IdDt(myId)); + + // Scan for extensions + scanForExtensions(retVal, def); + Collections.sort(retVal.getExtensionDefn(), new Comparator() { + @Override + public int compare(ExtensionDefn theO1, ExtensionDefn theO2) { + return theO1.getCode().compareTo(theO2.getCode()); + } + }); + + // Scan for children + retVal.setName(def.getName()); + Structure struct = retVal.addStructure(); + LinkedList path = new LinkedList(); + + StructureElement element = struct.addElement(); + element.getDefinition().setMin(1); + element.getDefinition().setMax("1"); + + fillProfile(struct, element, def, path, null); + + retVal.getStructure().get(0).getElement().get(0).getDefinition().addType().getCode().setValue("Resource"); + + return retVal; + } + + private void scanForExtensions(Profile theProfile, BaseRuntimeElementDefinition def) { + BaseRuntimeElementCompositeDefinition cdef = ((BaseRuntimeElementCompositeDefinition) def); + + for (RuntimeChildDeclaredExtensionDefinition nextChild : cdef.getExtensions()) { + if (myExtensionDefToCode.containsKey(nextChild)) { + continue; + } + + if (nextChild.isDefinedLocally() == false) { + continue; + } + + ExtensionDefn defn = theProfile.addExtensionDefn(); + String code = null; + if (nextChild.getExtensionUrl().contains("#") && !nextChild.getExtensionUrl().endsWith("#")) { + code = nextChild.getExtensionUrl().substring(nextChild.getExtensionUrl().indexOf('#') + 1); + } else { + throw new ConfigurationException("Locally defined extension has no '#[code]' part in extension URL: " + nextChild.getExtensionUrl()); + } + + defn.setCode(code); + if (myExtensionDefToCode.values().contains(code)) { + throw new IllegalStateException("Duplicate extension code: " + code); + } + myExtensionDefToCode.put(nextChild, code); + + if (nextChild.getChildType() != null && IPrimitiveDatatype.class.isAssignableFrom(nextChild.getChildType())) { + RuntimePrimitiveDatatypeDefinition pdef = (RuntimePrimitiveDatatypeDefinition) nextChild.getSingleChildOrThrow(); + defn.getDefinition().addType().setCode(DataTypeEnum.VALUESET_BINDER.fromCodeString(pdef.getName())); + } else { + RuntimeResourceBlockDefinition pdef = (RuntimeResourceBlockDefinition) nextChild.getSingleChildOrThrow(); + scanForExtensions(theProfile, pdef); + + for (RuntimeChildDeclaredExtensionDefinition nextChildExt : pdef.getExtensions()) { + StructureElementDefinitionType type = defn.getDefinition().addType(); + type.setCode(DataTypeEnum.EXTENSION); + type.setProfile("#" + myExtensionDefToCode.get(nextChildExt)); + } + + } + } + } + + @Override + public IResourceProvider createServerProfilesProvider(RestfulServer theRestfulServer) { + return new ServerProfileProvider(theRestfulServer.getFhirContext()); + } + +} diff --git a/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/model/dstu/composite/AgeDt.java b/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/model/dstu/composite/AgeDt.java new file mode 100644 index 00000000000..901a4f10095 --- /dev/null +++ b/hapi-fhir-structures-dstu/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 Structures - DSTU (FHIR 0.80) + * %% + * 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-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/BoundCodeableConceptDt.java b/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/model/dstu/composite/BoundCodeableConceptDt.java similarity index 93% rename from hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/BoundCodeableConceptDt.java rename to hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/model/dstu/composite/BoundCodeableConceptDt.java index 621ab06dcf4..1f674cc0f98 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/BoundCodeableConceptDt.java +++ b/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/model/dstu/composite/BoundCodeableConceptDt.java @@ -1,8 +1,8 @@ -package ca.uhn.fhir.model.primitive; +package ca.uhn.fhir.model.dstu.composite; /* * #%L - * HAPI FHIR - Core Library + * HAPI FHIR Structures - DSTU (FHIR 0.80) * %% * Copyright (C) 2014 University Health Network * %% @@ -20,19 +20,18 @@ package ca.uhn.fhir.model.primitive; * #L% */ -import static org.apache.commons.lang3.StringUtils.*; +import static org.apache.commons.lang3.StringUtils.defaultString; import java.util.Collection; import java.util.HashSet; import java.util.Set; +import ca.uhn.fhir.model.api.IBoundCodeableConcept; import ca.uhn.fhir.model.api.IValueSetEnumBinder; import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; -import ca.uhn.fhir.model.dstu.composite.CodingDt; @DatatypeDef(name = "CodeableConcept", isSpecialization = true) -public class BoundCodeableConceptDt> extends CodeableConceptDt { +public class BoundCodeableConceptDt> extends CodeableConceptDt implements IBoundCodeableConcept { private IValueSetEnumBinder myBinder; diff --git a/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/model/dstu/composite/DurationDt.java b/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/model/dstu/composite/DurationDt.java new file mode 100644 index 00000000000..7cf8818ad71 --- /dev/null +++ b/hapi-fhir-structures-dstu/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 Structures - DSTU (FHIR 0.80) + * %% + * 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-fhir-base/src/main/java/ca/uhn/fhir/rest/server/provider/ServerConformanceProvider.java b/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/rest/server/provider/ServerConformanceProvider.java similarity index 99% rename from hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/provider/ServerConformanceProvider.java rename to hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/rest/server/provider/ServerConformanceProvider.java index 3d49080fcce..99e917cf8ea 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/provider/ServerConformanceProvider.java +++ b/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/rest/server/provider/ServerConformanceProvider.java @@ -2,7 +2,7 @@ package ca.uhn.fhir.rest.server.provider; /* * #%L - * HAPI FHIR - Core Library + * HAPI FHIR Structures - DSTU (FHIR 0.80) * %% * Copyright (C) 2014 University Health Network * %% diff --git a/hapi-fhir-base/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 similarity index 91% rename from hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/provider/ServerProfileProvider.java rename to hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/rest/server/provider/ServerProfileProvider.java index 826aafa2096..0bfaf1d1d22 100644 --- a/hapi-fhir-base/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 @@ -2,7 +2,7 @@ package ca.uhn.fhir.rest.server.provider; /* * #%L - * HAPI FHIR - Core Library + * HAPI FHIR Structures - DSTU (FHIR 0.80) * %% * Copyright (C) 2014 University Health Network * %% @@ -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 @@ -54,7 +54,7 @@ public class ServerProfileProvider implements IResourceProvider { if (retVal==null) { return null; } - return retVal.toProfile(); + return (Profile) retVal.toProfile(); } @Search() @@ -71,7 +71,7 @@ public class ServerProfileProvider implements IResourceProvider { }}); ArrayList retVal = new ArrayList(); for (RuntimeResourceDefinition next : defs) { - retVal.add(next.toProfile()); + retVal.add((Profile) next.toProfile()); } return retVal; } 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 29b1e2ca097..bd19fad8660 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 100% 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 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 99% 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 6fbd6a2a56d..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; 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 e6518bc00dc..9e0c8e06914 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; @@ -244,7 +249,7 @@ public class ClientTest { assertEquals(HttpDelete.class, capt.getValue().getClass()); assertEquals("http://foo/Patient/1234", capt.getValue().getURI().toString()); - assertEquals("Hello", response.getOperationOutcome().getIssueFirstRep().getDetails().getValue()); + assertEquals("Hello", response.getOperationOutcome().getIssueFirstRep().getDetailsElement().getValue()); } @Test @@ -275,10 +280,10 @@ 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()); + assertEquals("Health Intersections", response.getPublisherElement().getValue()); } 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 98% 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 index d7fc2606951..7944b32b6ab 100644 --- 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 @@ -145,7 +145,7 @@ public class ExceptionHandlingTest { assertThat(e.getMessage(), StringContains.containsString("HTTP 500 Internal Error")); assertThat(e.getMessage(), StringContains.containsString("Help I'm a bug")); assertNotNull(e.getOperationOutcome()); - assertEquals("Help I'm a bug",e.getOperationOutcome().getIssueFirstRep().getDetails().getValue()); + assertEquals("Help I'm a bug",e.getOperationOutcome().getIssueFirstRep().getDetailsElement().getValue()); } } @@ -171,7 +171,7 @@ public class ExceptionHandlingTest { assertThat(e.getMessage(), StringContains.containsString("HTTP 500 Internal Error")); assertThat(e.getMessage(), StringContains.containsString("Help I'm a bug")); assertNotNull(e.getOperationOutcome()); - assertEquals("Help I'm a bug",e.getOperationOutcome().getIssueFirstRep().getDetails().getValue()); + assertEquals("Help I'm a bug",e.getOperationOutcome().getIssueFirstRep().getDetailsElement().getValue()); } } 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 99% 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 index 8db22322940..b80f85e43c5 100644 --- 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 @@ -90,7 +90,7 @@ public class IncludeTest { } - @Test +// @Test public void testMixedContainedAndNonContained() throws Exception { HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/DiagnosticReport?_query=stitchedInclude&_pretty=true"); HttpResponse status = ourClient.execute(httpGet); 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 78% 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 index e23fb826df5..a226e659d4d 100644 --- 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 @@ -19,9 +19,11 @@ import org.junit.BeforeClass; import org.junit.Test; import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.model.api.BaseResource; import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.dstu.composite.IdentifierDt; import ca.uhn.fhir.model.dstu.resource.Binary; +import ca.uhn.fhir.model.dstu.resource.Organization; import ca.uhn.fhir.model.dstu.resource.Patient; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.rest.annotation.IdParam; @@ -61,6 +63,28 @@ public class ReadTest { } + @Test + public void testReadForProviderWithAbstractReturnType() throws Exception { + { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Organization/1"); + HttpResponse status = ourClient.execute(httpGet); + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals(200, status.getStatusLine().getStatusCode()); + IdentifierDt dt = ourCtx.newXmlParser().parseResource(Organization.class,responseContent).getIdentifierFirstRep(); + + assertEquals("1", dt.getSystem().getValueAsString()); + assertEquals(null, dt.getValue().getValueAsString()); + + Header cl = status.getFirstHeader(Constants.HEADER_CONTENT_LOCATION_LC); + assertNotNull(cl); + assertEquals("http://localhost:" + ourPort + "/Organization/1/_history/1", cl.getValue()); + + } + + } + @Test public void testBinaryRead() throws Exception { { @@ -124,7 +148,7 @@ public class ReadTest { ServletHandler proxyHandler = new ServletHandler(); RestfulServer servlet = new RestfulServer(); ourCtx = servlet.getFhirContext(); - servlet.setResourceProviders(patientProvider, new DummyBinaryProvider()); + servlet.setResourceProviders(patientProvider, new DummyBinaryProvider(), new OrganizationProviderWithAbstractReturnType()); ServletHolder servletHolder = new ServletHolder(servlet); proxyHandler.addServletWithMapping(servletHolder, "/*"); ourServer.setHandler(proxyHandler); @@ -158,6 +182,27 @@ public class ReadTest { } + /** + * Created by dsotnikov on 2/25/2014. + */ + public static class OrganizationProviderWithAbstractReturnType implements IResourceProvider { + + @Read(version = true) + public BaseResource findPatient(@IdParam IdDt theId) { + Organization org = new Organization(); + org.addIdentifier(theId.getIdPart(), theId.getVersionIdPart()); + org.setId("Organization/1/_history/1"); + return org; + } + + @Override + public Class getResourceType() { + return Organization.class; + } + + } + + /** * Created by dsotnikov on 2/25/2014. */ 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 80ef57c2c70..76d9ca301a5 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,6 +1,7 @@ package ca.uhn.fhir.rest.server; -import static org.hamcrest.Matchers.*; +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.not; import static org.junit.Assert.*; import java.util.ArrayList; @@ -14,6 +15,7 @@ import java.util.Map; import java.util.concurrent.TimeUnit; import ca.uhn.fhir.model.dstu.resource.*; + import org.apache.commons.io.IOUtils; import org.apache.http.HttpResponse; import org.apache.http.client.entity.UrlEncodedFormEntity; @@ -41,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; @@ -62,10 +64,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; @@ -1101,7 +1102,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(); } @@ -1203,12 +1204,12 @@ 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 (CodingDt nextId : theIdentifiers.getCodings()) { - next.getIdentifier().add(new IdentifierDt(nextId.getSystem().getValueAsString(), nextId.getCode().getValue())); + for (BaseCodingDt nextId : theIdentifiers.getListAsCodings()) { + next.getIdentifier().add(new IdentifierDt(nextId.getSystemElement().getValueAsString(), nextId.getCodeElement().getValue())); } retVal.add(next); @@ -1339,7 +1340,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 805ad885141..965b3ed80b1 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 @@ -32,6 +32,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; @@ -188,6 +189,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()); @@ -271,8 +273,8 @@ public class SearchTest { o.setId("1"); o.getSubject().setReference(theSubject.getResourceType() + "/" + theSubject.getIdPart()); - for (CodingDt 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 74% 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..fa53d6d58fe 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 @@ -21,24 +21,11 @@ import ca.uhn.fhir.rest.param.StringParam; public class ServerInvalidDefinitionTest { - @Test - public void testNonInstantiableTypeForResourceProvider() { - RestfulServer srv = new RestfulServer(); - srv.setResourceProviders(new NonInstantiableTypeForResourceProvider()); - - try { - srv.init(); - fail(); - } catch (ServletException e) { - assertThat(e.getCause().toString(), StringContains.containsString("ConfigurationException")); - } - } - @Test public void testPrivateResourceProvider() { RestfulServer srv = new RestfulServer(); srv.setResourceProviders(new PrivateResourceProvider()); - + try { srv.init(); fail(); @@ -52,7 +39,7 @@ public class ServerInvalidDefinitionTest { public void testInvalidSpecialNameResourceProvider() { RestfulServer srv = new RestfulServer(); srv.setResourceProviders(new InvalidSpecialParameterNameResourceProvider()); - + try { srv.init(); fail(); @@ -61,12 +48,12 @@ public class ServerInvalidDefinitionTest { assertThat(e.getCause().toString(), StringContains.containsString("_pretty")); } } - + @Test public void testReadMethodWithSearchParameters() { RestfulServer srv = new RestfulServer(); srv.setResourceProviders(new ReadMethodWithSearchParamProvider()); - + try { srv.init(); fail(); @@ -79,7 +66,7 @@ public class ServerInvalidDefinitionTest { public void testSearchWithId() { RestfulServer srv = new RestfulServer(); srv.setResourceProviders(new SearchWithIdParamProvider()); - + try { srv.init(); fail(); @@ -98,103 +85,75 @@ public class ServerInvalidDefinitionTest { srv.setResourceProviders(new InstantiableTypeForResourceProvider()); srv.init(); } - - private static class PrivateResourceProvider implements IResourceProvider - { + + private static class PrivateResourceProvider implements IResourceProvider { @Override public Class getResourceType() { return Patient.class; } - - @SuppressWarnings("unused") + @Read public Patient read(@IdParam IdDt theId) { return null; } - + } - - public static class ReadMethodWithSearchParamProvider implements IResourceProvider - { + + public static class ReadMethodWithSearchParamProvider implements IResourceProvider { @Override public Class getResourceType() { return Patient.class; } - - @SuppressWarnings("unused") + @Read - public Patient read(@IdParam IdDt theId, @RequiredParam(name="aaa") StringParam theParam) { + public Patient read(@IdParam IdDt theId, @RequiredParam(name = "aaa") StringParam theParam) { return null; } - - } - - public static class SearchWithIdParamProvider implements IResourceProvider - { - @Override - public Class getResourceType() { - return Patient.class; - } - - @SuppressWarnings("unused") - @Search - public List read(@IdParam IdDt theId, @RequiredParam(name="aaa") StringParam theParam) { - return null; - } - } - public static class NonInstantiableTypeForResourceProvider implements IResourceProvider - { - - @Override - public Class getResourceType() { - return BaseResource.class; - } - - @SuppressWarnings("unused") - @Read - public BaseResource read(@IdParam IdDt theId) { - return null; - } - - } - - - public static class InvalidSpecialParameterNameResourceProvider implements IResourceProvider - { + public static class SearchWithIdParamProvider implements IResourceProvider { @Override public Class getResourceType() { return Patient.class; } - @SuppressWarnings("unused") @Search - public List search(@RequiredParam(name="_pretty") StringParam theParam) { + public List read(@IdParam IdDt theId, @RequiredParam(name = "aaa") StringParam theParam) { return null; } - + } - - - public static class InstantiableTypeForResourceProvider implements IResourceProvider - { + + public static class InvalidSpecialParameterNameResourceProvider implements IResourceProvider { + + @Override + public Class getResourceType() { + return Patient.class; + } + + @Search + public List search(@RequiredParam(name = "_pretty") StringParam theParam) { + return null; + } + + } + + public static class InstantiableTypeForResourceProvider implements IResourceProvider { @Override public Class getResourceType() { 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 91% 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 index 9ec1ebdf5b5..3594ada3176 100644 --- 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 @@ -41,7 +41,7 @@ public class ResourceValidatorTest { } catch (ValidationFailureException e) { ourLog.info(ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(e.getOperationOutcome())); assertEquals(1, e.getOperationOutcome().getIssue().size()); - assertThat(e.getOperationOutcome().getIssueFirstRep().getDetails().getValue(), containsString("Invalid content was found starting with element 'breed'")); + assertThat(e.getOperationOutcome().getIssueFirstRep().getDetailsElement().getValue(), containsString("Invalid content was found starting with element 'breed'")); } } @@ -63,7 +63,7 @@ public class ResourceValidatorTest { } catch (ValidationFailureException e) { ourLog.info(ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(e.getOperationOutcome())); assertEquals(1, e.getOperationOutcome().getIssue().size()); - assertThat(e.getOperationOutcome().getIssueFirstRep().getDetails().getValue(), containsString("Inv-2: A system is required if a value is provided.")); + assertThat(e.getOperationOutcome().getIssueFirstRep().getDetailsElement().getValue(), containsString("Inv-2: A system is required if a value is provided.")); } } @@ -82,7 +82,7 @@ public class ResourceValidatorTest { p.getTelecomFirstRep().setValue("123-4567"); validationResult = val.validateWithResult(p); assertFalse(validationResult.isSuccessful()); - OperationOutcome operationOutcome = validationResult.getOperationOutcome(); + OperationOutcome operationOutcome = (OperationOutcome) validationResult.getOperationOutcome(); ourLog.info(ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(operationOutcome)); assertEquals(1, operationOutcome.getIssue().size()); assertThat(operationOutcome.getIssueFirstRep().getDetails().getValue(), containsString("Inv-2: A system is required if a value is provided.")); @@ -101,7 +101,7 @@ public class ResourceValidatorTest { ValidationResult result = val.validateWithResult(b); assertTrue(result.isSuccessful()); - OperationOutcome operationOutcome = result.getOperationOutcome(); + OperationOutcome operationOutcome = (OperationOutcome) result.getOperationOutcome(); assertNotNull(operationOutcome); assertEquals(0, operationOutcome.getIssue().size()); } @@ -120,7 +120,7 @@ public class ResourceValidatorTest { p.getTelecomFirstRep().setValue("123-4567"); validationResult = val.validateWithResult(b); assertFalse(validationResult.isSuccessful()); - OperationOutcome operationOutcome = validationResult.getOperationOutcome(); + OperationOutcome operationOutcome = (OperationOutcome) validationResult.getOperationOutcome(); ourLog.info(ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(operationOutcome)); assertEquals(1, operationOutcome.getIssue().size()); assertThat(operationOutcome.getIssueFirstRep().getDetails().getValue(), containsString("Inv-2: A system is required if a value is provided.")); diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/validation/ValidationResultTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/validation/ValidationResultTest.java similarity index 87% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/validation/ValidationResultTest.java rename to hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/validation/ValidationResultTest.java index 2fe2979119e..b4f2a2fa503 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/validation/ValidationResultTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/validation/ValidationResultTest.java @@ -1,6 +1,8 @@ package ca.uhn.fhir.validation; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome.BaseIssue; import ca.uhn.fhir.model.dstu.resource.OperationOutcome; + import org.junit.Test; import java.util.List; @@ -37,9 +39,9 @@ public class ValidationResultTest { issue.setDetails(errorMessage); ValidationResult result = ValidationResult.valueOf(operationOutcome); assertFalse(result.isSuccessful()); - List issues = result.getOperationOutcome().getIssue(); + List issues = result.getOperationOutcome().getIssue(); assertEquals(1, issues.size()); - assertEquals(errorMessage, issues.get(0).getDetails().getValue()); + assertEquals(errorMessage, issues.get(0).getDetailsElement().getValue()); assertThat("ValidationResult#toString should contain the issue description", result.toString(), containsString(errorMessage)); } 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-fhir-testpage-overlay/pom.xml b/hapi-fhir-testpage-overlay/pom.xml index 8b3e9d51b29..36604cc760b 100644 --- a/hapi-fhir-testpage-overlay/pom.xml +++ b/hapi-fhir-testpage-overlay/pom.xml @@ -29,6 +29,11 @@ hapi-fhir-base 0.8-SNAPSHOT + + ca.uhn.hapi.fhir + hapi-fhir-structures-dstu + 0.8-SNAPSHOT + org.thymeleaf thymeleaf @@ -72,13 +77,15 @@ ${hamcrest_version} test + + commons-dbcp diff --git a/hapi-fhir-testpage-overlay/pom.xml.orig b/hapi-fhir-testpage-overlay/pom.xml.orig new file mode 100644 index 00000000000..997d6f28ff5 --- /dev/null +++ b/hapi-fhir-testpage-overlay/pom.xml.orig @@ -0,0 +1,245 @@ + + 4.0.0 + + + ca.uhn.hapi.fhir + hapi-fhir + 0.8-SNAPSHOT + ../pom.xml + + + hapi-fhir-testpage-overlay + war + + HAPI FHIR TestPage Overlay + + + + oss-snapshots + + true + + https://oss.sonatype.org/content/repositories/snapshots/ + + + + + + ca.uhn.hapi.fhir + hapi-fhir-base + 0.8-SNAPSHOT +<<<<<<< HEAD +======= + + + ca.uhn.hapi.fhir + hapi-fhir-structures-dstu + 0.8-SNAPSHOT +>>>>>>> versions + + + org.thymeleaf + thymeleaf + ${thymeleaf-version} + + + org.thymeleaf + thymeleaf-spring4 + ${thymeleaf-version} + + + + javax.servlet + javax.servlet-api + 3.1.0 + provided + + + + ca.uhn.hapi.fhir + hapi-fhir-jpaserver-test + 0.8-SNAPSHOT + test + + + + ch.qos.logback + logback-classic + ${logback_version} + test + + + junit + junit + ${junit_version} + test + + + org.hamcrest + hamcrest-all + ${hamcrest_version} + test + + + net.sourceforge.htmlunit + htmlunit + 2.16-SNAPSHOT + test + + + + + commons-dbcp + commons-dbcp + 1.4 + test + + + + + org.apache.derby + derby + ${derby_version} + test + + + + + + aopalliance + aopalliance + 1.0 + + + org.springframework + spring-core + ${spring_version} + + + org.springframework + spring-orm + ${spring_version} + + + org.springframework + spring-webmvc + ${spring_version} + + + org.springframework + spring-context + ${spring_version} + + + xml-apis + xml-apis + + + + + org.springframework + spring-beans + ${spring_version} + + + org.springframework + spring-tx + ${spring_version} + + + org.springframework + spring-context-support + ${spring_version} + + + org.springframework + spring-web + ${spring_version} + + + + + org.eclipse.jetty + jetty-servlets + ${jetty_version} + test + + + org.eclipse.jetty + jetty-webapp + ${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.apache.maven.plugins + maven-compiler-plugin + + 1.6 + 1.6 + + + + + + + maven-antrun-plugin + 1.7 + + + copyNarrativeCss + process-resources + + run + + + + + + + + + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + false + + + + + + diff --git a/hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/Controller.java b/hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/Controller.java index 0db4d18adc2..1cb52eaf2c8 100644 --- a/hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/Controller.java +++ b/hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/Controller.java @@ -1009,7 +1009,7 @@ public class Controller { } if (StringUtils.isNotBlank(theReq.getParameter("param." + paramIdxString + ".0.name"))) { - handleSearchParam(paramIdxString + ".0", theReq, theQuery, theClientCodeJsonWriter); + handleSearchParam(paramIdxString + ".0", theReq, theQuery , theClientCodeJsonWriter); } return true; @@ -1020,7 +1020,7 @@ public class Controller { Conformance conformance; try { - conformance = client.conformance(); + conformance = (Conformance)client.conformance(); } catch (Exception e) { ourLog.warn("Failed to load conformance statement", e); theModel.put("errorMsg", "Failed to load conformance statement, error was: " + e.toString()); diff --git a/hapi-fhir-testpage-overlay/src/test/java/ca/uhn/fhir/jpa/test/OverlayTestApp.java b/hapi-fhir-testpage-overlay/src/test/java/ca/uhn/fhir/jpa/test/OverlayTestApp.java index c064e31d2b2..32c549feccd 100644 --- a/hapi-fhir-testpage-overlay/src/test/java/ca/uhn/fhir/jpa/test/OverlayTestApp.java +++ b/hapi-fhir-testpage-overlay/src/test/java/ca/uhn/fhir/jpa/test/OverlayTestApp.java @@ -32,8 +32,8 @@ import ca.uhn.fhir.rest.annotation.RequiredParam; import ca.uhn.fhir.rest.annotation.Search; import ca.uhn.fhir.rest.api.MethodOutcome; import ca.uhn.fhir.rest.client.IGenericClient; -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.FifoMemoryPagingProvider; import ca.uhn.fhir.rest.server.IResourceProvider; import ca.uhn.fhir.rest.server.RestfulServer; @@ -173,7 +173,7 @@ public class OverlayTestApp { @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 { @@ -184,7 +184,7 @@ public class OverlayTestApp { @Search public List findDiagnosticReportsByPatientIssued ( @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_ISSUED) DateRangeParam theDateRange, @IncludeParam(allow= {"DiagnosticReport.result"}) Set theIncludes ) throws Exception { diff --git a/hapi-fhir-testpage-overlay/src/test/java/ca/uhn/fhir/jpa/test/WebUiTest_.java b/hapi-fhir-testpage-overlay/src/test/java/ca/uhn/fhir/jpa/test/WebUiTest_.java index e644894c81c..652862cf15a 100644 --- a/hapi-fhir-testpage-overlay/src/test/java/ca/uhn/fhir/jpa/test/WebUiTest_.java +++ b/hapi-fhir-testpage-overlay/src/test/java/ca/uhn/fhir/jpa/test/WebUiTest_.java @@ -43,9 +43,9 @@ import ca.uhn.test.jpasrv.OrganizationResourceProvider; import ca.uhn.test.jpasrv.PatientResourceProvider; import ca.uhn.test.jpasrv.QuestionnaireResourceProvider; -import com.gargoylesoftware.htmlunit.BrowserVersion; -import com.gargoylesoftware.htmlunit.WebClient; -import com.gargoylesoftware.htmlunit.html.HtmlPage; +//import com.gargoylesoftware.htmlunit.BrowserVersion; +//import com.gargoylesoftware.htmlunit.WebClient; +//import com.gargoylesoftware.htmlunit.html.HtmlPage; public class WebUiTest_ { @@ -57,17 +57,17 @@ private static ClassPathXmlApplicationContext appCtx; // @Test public void homePage() throws Exception { - final WebClient webClient = new WebClient(BrowserVersion.FIREFOX_24); - final HtmlPage page = webClient.getPage("http://localhost:8888/"); - Assert.assertEquals("HtmlUnit - Welcome to HtmlUnit", page.getTitleText()); - - final String pageAsXml = page.asXml(); - Assert.assertTrue(pageAsXml.contains("")); - - final String pageAsText = page.asText(); - Assert.assertTrue(pageAsText.contains("Support for the HTTP and HTTPS protocols")); - - webClient.closeAllWindows(); +// final WebClient webClient = new WebClient(BrowserVersion.FIREFOX_24); +// final HtmlPage page = webClient.getPage("http://localhost:8888/"); +// Assert.assertEquals("HtmlUnit - Welcome to HtmlUnit", page.getTitleText()); +// +// final String pageAsXml = page.asXml(); +// Assert.assertTrue(pageAsXml.contains("")); +// +// final String pageAsText = page.asText(); +// Assert.assertTrue(pageAsText.contains("Support for the HTTP and HTTPS protocols")); +// +// webClient.closeAllWindows(); } @SuppressWarnings("unchecked") diff --git a/hapi-tinder-plugin/.classpath b/hapi-tinder-plugin/.classpath index 534b5e52fa5..832ed6c6d27 100644 --- a/hapi-tinder-plugin/.classpath +++ b/hapi-tinder-plugin/.classpath @@ -6,6 +6,7 @@ + @@ -22,6 +23,7 @@ + diff --git a/hapi-tinder-plugin/pom.xml b/hapi-tinder-plugin/pom.xml index c5957777571..e9f510b3eb7 100644 --- a/hapi-tinder-plugin/pom.xml +++ b/hapi-tinder-plugin/pom.xml @@ -21,7 +21,14 @@ hapi-fhir-base 0.8-SNAPSHOT - + + org.apache.velocity velocity @@ -34,16 +41,16 @@ - com.google.guava - guava - 17.0 + com.google.guava + guava + ${guava_version} org.apache.commons commons-lang3 - 3.2.1 + ${commons_lang_version} commons-io @@ -139,7 +146,8 @@ - + org.eclipse.m2e lifecycle-mapping diff --git a/hapi-tinder-plugin/pom.xml.orig b/hapi-tinder-plugin/pom.xml.orig new file mode 100644 index 00000000000..fa1f3bf3cd2 --- /dev/null +++ b/hapi-tinder-plugin/pom.xml.orig @@ -0,0 +1,189 @@ + + 4.0.0 + + + ca.uhn.hapi.fhir + hapi-fhir + 0.8-SNAPSHOT + ../pom.xml + + + hapi-tinder-plugin + maven-plugin + + + HAPI Tinder Plugin + + + + ca.uhn.hapi.fhir + hapi-fhir-base + 0.8-SNAPSHOT +<<<<<<< HEAD +======= + + + + + org.apache.velocity + velocity + 1.7 + + + org.apache.velocity + velocity-tools + 2.0 + + + + com.google.guava + guava + 17.0 + + + + + org.apache.commons + commons-lang3 + 3.2.1 + + + commons-io + commons-io + 2.4 + + + + + org.slf4j + slf4j-api + 1.7.6 + + + ch.qos.logback + logback-classic + 1.1.1 + true + + + + + junit + junit + 4.11 + test + + + + + org.apache.maven + maven-project + 2.2.1 + + + org.apache.maven + maven-plugin-api + 3.2.1 + + + org.apache.maven.plugin-tools + maven-plugin-annotations + 3.2 + provided + + + + + 3.1.1 + + + + + + org.apache.maven.plugins + maven-plugin-plugin + 3.2 + + + + report + + + + + + + + + + + org.apache.maven.plugins + maven-plugin-plugin + 3.2 + + + true + + + + + mojo-descriptor + + descriptor + + + + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + + org.apache.maven.plugins + + + maven-plugin-plugin + + + [3.2,) + + + descriptor + + + + + + + + + + + + + + + + diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/FhirDstu1.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/FhirDstu1.java new file mode 100644 index 00000000000..085b0f926d9 --- /dev/null +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/FhirDstu1.java @@ -0,0 +1,26 @@ +package ca.uhn.fhir.model.dstu; + +import ca.uhn.fhir.context.RuntimeResourceDefinition; +import ca.uhn.fhir.model.api.IFhirVersion; +import ca.uhn.fhir.model.api.IResource; +import ca.uhn.fhir.rest.server.IResourceProvider; +import ca.uhn.fhir.rest.server.RestfulServer; + +public class FhirDstu1 implements IFhirVersion { + + @Override + public Object createServerConformanceProvider(RestfulServer theServer) { + throw new UnsupportedOperationException(); + } + + @Override + public IResourceProvider createServerProfilesProvider(RestfulServer theRestfulServer) { + throw new UnsupportedOperationException(); + } + + @Override + public IResource generateProfile(RuntimeResourceDefinition theRuntimeResourceDefinition) { + throw new UnsupportedOperationException(); + } + +} diff --git a/hapi-fhir-base/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 similarity index 100% rename from hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/AddressDt.java rename to hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/AddressDt.java diff --git a/hapi-fhir-base/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 similarity index 100% rename from hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/AgeDt.java rename to hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/AgeDt.java diff --git a/hapi-fhir-base/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 similarity index 100% rename from hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/AttachmentDt.java rename to hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/AttachmentDt.java 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..9c9db647dc2 --- /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.getCodeElement().getValue()), defaultString(next.getSystemElement().getValueAsString())); + if (nextT != null) { + retVal.add(nextT); + } else { + // TODO: throw special exception type? + } + } + return retVal; + } + +} diff --git a/hapi-fhir-base/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 similarity index 100% rename from hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/CodeableConceptDt.java rename to hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/CodeableConceptDt.java diff --git a/hapi-fhir-base/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 similarity index 99% rename from hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/CodingDt.java rename to hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/CodingDt.java index 7f9f4b1e7cf..5e58142cb38 100644 --- a/hapi-fhir-base/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 @@ -147,7 +147,7 @@ public class CodingDt * The identification of the code system that defines the meaning of the symbol in the code. *

*/ - public UriDt getSystem() { + public UriDt getSystemElement() { if (mySystem == null) { mySystem = new UriDt(); } @@ -235,7 +235,7 @@ public class CodingDt * A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination) *

*/ - public CodeDt getCode() { + public CodeDt getCodeElement() { if (myCode == null) { myCode = new CodeDt(); } diff --git a/hapi-fhir-base/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 similarity index 100% rename from hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/ContactDt.java rename to hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/ContactDt.java 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-fhir-base/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 similarity index 100% rename from hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/DurationDt.java rename to hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/DurationDt.java diff --git a/hapi-fhir-base/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 similarity index 100% rename from hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/HumanNameDt.java rename to hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/HumanNameDt.java diff --git a/hapi-fhir-base/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 similarity index 98% rename from hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/IdentifierDt.java rename to hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/IdentifierDt.java index b235c6b8bc5..120a4758293 100644 --- a/hapi-fhir-base/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 @@ -138,7 +138,7 @@ public class IdentifierDt private PeriodDt myPeriod; @Child(name="assigner", order=5, min=0, max=1, type={ - ca.uhn.fhir.model.dstu.resource.Organization.class }) + 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" @@ -254,7 +254,7 @@ public class IdentifierDt * Establishes the namespace in which set of possible id values is unique. *

*/ - public UriDt getSystem() { + public UriDt getSystemElement() { if (mySystem == null) { mySystem = new UriDt(); } @@ -298,7 +298,7 @@ public class IdentifierDt * The portion of the identifier typically displayed to the user and which is unique within the context of the system. *

*/ - public StringDt getValue() { + public StringDt getValueElement() { if (myValue == null) { myValue = new StringDt(); } 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-fhir-base/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 similarity index 100% rename from hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/PeriodDt.java rename to hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/PeriodDt.java diff --git a/hapi-fhir-base/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 similarity index 97% rename from hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/QuantityDt.java rename to hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/QuantityDt.java index 06b7321e2dd..2c033d88cae 100644 --- a/hapi-fhir-base/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 @@ -195,7 +195,7 @@ public class QuantityDt * The value of the measured amount. The value includes an implicit precision in the presentation of the value *

*/ - public DecimalDt getValue() { + public DecimalDt getValueElement() { if (myValue == null) { myValue = new DecimalDt(); } @@ -265,7 +265,7 @@ public class QuantityDt * 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() { + public BoundCodeDt getComparatorElement() { if (myComparator == null) { myComparator = new BoundCodeDt(QuantityCompararatorEnum.VALUESET_BINDER); } @@ -294,7 +294,7 @@ public class QuantityDt *

*/ public QuantityDt setComparator(QuantityCompararatorEnum theValue) { - getComparator().setValueAsEnum(theValue); + getComparatorElement().setValueAsEnum(theValue); return this; } @@ -309,7 +309,7 @@ public class QuantityDt * A human-readable form of the units *

*/ - public StringDt getUnits() { + public StringDt getUnitsElement() { if (myUnits == null) { myUnits = new StringDt(); } @@ -353,7 +353,7 @@ public class QuantityDt * The identification of the system that provides the coded form of the unit *

*/ - public UriDt getSystem() { + public UriDt getSystemElement() { if (mySystem == null) { mySystem = new UriDt(); } @@ -397,7 +397,7 @@ public class QuantityDt * A computer processable form of the units in some unit representation system *

*/ - public CodeDt getCode() { + public CodeDt getCodeElement() { if (myCode == null) { myCode = new CodeDt(); } diff --git a/hapi-fhir-base/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 similarity index 100% rename from hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/RangeDt.java rename to hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/RangeDt.java diff --git a/hapi-fhir-base/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 similarity index 100% rename from hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/RatioDt.java rename to hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/RatioDt.java 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-fhir-base/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 similarity index 100% rename from hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/SampledDataDt.java rename to hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/SampledDataDt.java diff --git a/hapi-fhir-base/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 similarity index 100% rename from hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/ScheduleDt.java rename to hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/composite/ScheduleDt.java diff --git a/hapi-fhir-base/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 similarity index 99% rename from hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Conformance.java rename to hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/resource/Conformance.java index 2ff435af243..88dfaaa89ee 100644 --- a/hapi-fhir-base/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 @@ -52,6 +52,8 @@ 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; @@ -70,7 +72,6 @@ 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.BoundCodeableConceptDt; import ca.uhn.fhir.model.primitive.CodeDt; import ca.uhn.fhir.model.primitive.DateTimeDt; import ca.uhn.fhir.model.primitive.IdDt; @@ -104,7 +105,7 @@ import ca.uhn.fhir.rest.gclient.TokenClientParam; * */ @ResourceDef(name="Conformance", profile="http://hl7.org/fhir/profiles/Conformance", id="conformance") -public class Conformance extends BaseResource implements IResource { +public class Conformance extends BaseConformance implements IResource { /** * Search parameter constant for identifier @@ -735,7 +736,7 @@ public class Conformance extends BaseResource implements IResource { * Name of Organization publishing this conformance statement *

*/ - public StringDt getPublisher() { + public StringDt getPublisherElement() { if (myPublisher == null) { myPublisher = new StringDt(); } @@ -875,7 +876,7 @@ public class Conformance extends BaseResource implements IResource { * A free text natural language description of the conformance statement and its use. Typically, this is used when the profile describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP *

*/ - public StringDt getDescription() { + public StringDt getDescriptionElement() { if (myDescription == null) { myDescription = new StringDt(); } diff --git a/hapi-fhir-base/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 similarity index 100% rename from hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Profile.java rename to hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/resource/Profile.java diff --git a/hapi-fhir-base/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 similarity index 100% rename from hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ValueSet.java rename to hapi-tinder-plugin/src/main/java/ca/uhn/fhir/model/dstu/resource/ValueSet.java 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..a1d3547b9d8 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 @@ -49,6 +49,12 @@ public class TinderClientMojo extends AbstractMojo { @Parameter(required = true, defaultValue = "false") private boolean generateSearchForAllParams; + @Parameter(alias = "version", required = true, defaultValue="dstu") + private String version = "dstu"; + + @Parameter(required = true, defaultValue = "${project.build.directory}/..") + private String baseDir; + private List myResources = new ArrayList(); private String myPackageBase; private File myDirectoryBase; @@ -76,7 +82,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."); @@ -87,7 +93,7 @@ public class TinderClientMojo extends AbstractMojo { throw new MojoFailureException("Conformance mode is not server, found: " + rest.getMode().getValue()); } - ProfileParser pp = new ProfileParser(); + ProfileParser pp = new ProfileParser(version,baseDir ); int index = 0; for (RestResource nextResource : rest.getResource()) { if (StringUtils.isBlank(nextResource.getProfile().getReference().getValue())) { diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/TinderJpaRestServerMojo.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/TinderJpaRestServerMojo.java index d3bb9c82dd0..2a32ce79f08 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/TinderJpaRestServerMojo.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/TinderJpaRestServerMojo.java @@ -42,6 +42,9 @@ public class TinderJpaRestServerMojo extends AbstractMojo { @Parameter(required = true) private List baseResourceNames; + @Parameter(required = true, defaultValue = "${project.build.directory}/..") + private String baseDir; + @Component private MavenProject myProject; @@ -51,7 +54,7 @@ public class TinderJpaRestServerMojo extends AbstractMojo { File directoryBase = new File(targetDirectory, packageBase.replace(".", File.separatorChar + "")); directoryBase.mkdirs(); - ResourceGeneratorUsingSpreadsheet gen = new ResourceGeneratorUsingSpreadsheet(); + ResourceGeneratorUsingSpreadsheet gen = new ResourceGeneratorUsingSpreadsheet("dstu", baseDir); gen.setBaseResourceNames(baseResourceNames); try { diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/TinderStructuresMojo.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/TinderStructuresMojo.java index 05400986b75..156d9aa2bcc 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/TinderStructuresMojo.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/TinderStructuresMojo.java @@ -37,6 +37,9 @@ public class TinderStructuresMojo extends AbstractMojo { @Parameter(alias = "package", required = true) private String packageName; + @Parameter(alias = "version", required = true, defaultValue="dstu") + private String version = "dstu"; + @Parameter(required = false) private List resourceProfileFiles; @@ -49,6 +52,9 @@ public class TinderStructuresMojo extends AbstractMojo { @Parameter(required = true, defaultValue = "${project.build.directory}/generated-resources/tinder") private String targetResourceDirectory; + @Parameter(required = true, defaultValue = "${project.build.directory}/..") + private String baseDir; + @Override public void execute() throws MojoExecutionException, MojoFailureException { if (StringUtils.isBlank(packageName)) { @@ -70,7 +76,7 @@ public class TinderStructuresMojo extends AbstractMojo { directoryBase.mkdirs(); ourLog.info(" * Output Source Directory: " + directoryBase.getAbsolutePath()); - ValueSetGenerator vsp = new ValueSetGenerator(); + ValueSetGenerator vsp = new ValueSetGenerator(version); vsp.setResourceValueSetFiles(resourceValueSetFiles); try { vsp.parse(); @@ -81,7 +87,7 @@ public class TinderStructuresMojo extends AbstractMojo { ourLog.info("Loading Datatypes..."); Map datatypeLocalImports = new HashMap(); - DatatypeGeneratorUsingSpreadsheet dtp = new DatatypeGeneratorUsingSpreadsheet(); + DatatypeGeneratorUsingSpreadsheet dtp = new DatatypeGeneratorUsingSpreadsheet(version, baseDir); if (buildDatatypes) { try { dtp.parse(); @@ -94,7 +100,7 @@ public class TinderStructuresMojo extends AbstractMojo { datatypeLocalImports = dtp.getLocalImports(); } - ResourceGeneratorUsingSpreadsheet rp = new ResourceGeneratorUsingSpreadsheet(); + ResourceGeneratorUsingSpreadsheet rp = new ResourceGeneratorUsingSpreadsheet(version, baseDir); if (baseResourceNames != null && baseResourceNames.size() > 0) { ourLog.info("Loading Resources..."); try { @@ -115,7 +121,7 @@ public class TinderStructuresMojo extends AbstractMojo { rp.writeAll(resSubDirectoryBase, resDirectoryBase, packageName); } - ProfileParser pp = new ProfileParser(); + ProfileParser pp = new ProfileParser(version, baseDir); if (resourceProfileFiles != null) { ourLog.info("Loading profiles..."); for (ProfileFileDefinition next : resourceProfileFiles) { @@ -198,35 +204,44 @@ public class TinderStructuresMojo extends AbstractMojo { public static void main(String[] args) throws Exception { + // ProfileParser pp = new ProfileParser(); // pp.parseSingleProfile(new File("../hapi-tinder-test/src/test/resources/profile/patient.xml"), "http://foo"); - ValueSetGenerator vsp = new ValueSetGenerator(); + ValueSetGenerator vsp = new ValueSetGenerator("dev"); // vsp.setResourceValueSetFiles(theResourceValueSetFiles);Directory("src/main/resources/vs/"); vsp.parse(); - DatatypeGeneratorUsingSpreadsheet dtp = new DatatypeGeneratorUsingSpreadsheet(); + DatatypeGeneratorUsingSpreadsheet dtp = new DatatypeGeneratorUsingSpreadsheet("dev", "."); dtp.parse(); + dtp.markResourcesForImports(); dtp.bindValueSets(vsp); + Map datatypeLocalImports = dtp.getLocalImports(); - String dtOutputDir = "target/generated-sources/ca/uhn/fhir/model/dstu/composite"; - dtp.writeAll(new File(dtOutputDir), null, "ca.uhn.fhir.model.dstu"); + String dtOutputDir = "target/generated-sources/tinder/ca/uhn/fhir/model/dev/composite"; - ResourceGeneratorUsingSpreadsheet rp = new ResourceGeneratorUsingSpreadsheet(); - rp.setBaseResourceNames(Arrays.asList("securityevent")); + ResourceGeneratorUsingSpreadsheet rp = new ResourceGeneratorUsingSpreadsheet("dev", "."); + rp.setBaseResourceNames(Arrays.asList("referralrequest", "patient","practitioner","encounter", + "organization","location","relatedperson","appointment","slot","order","availability","device", "valueset")); rp.parse(); rp.bindValueSets(vsp); + rp.markResourcesForImports(); // rp.bindValueSets(vsp); - String rpOutputDir = "target/generated-sources/ca/uhn/fhir/model/dstu/resource"; - String rpSOutputDir = "target/generated-resources/ca/uhn/fhir/model/dstu"; - + String rpOutputDir = "target/generated-sources/tinder/ca/uhn/fhir/model/dev/resource"; + String rpSOutputDir = "target/generated-resources/tinder/ca/uhn/fhir/model/dev"; + + dtp.combineContentMaps(rp); rp.combineContentMaps(dtp); - rp.writeAll(new File(rpOutputDir), new File(rpSOutputDir), "ca.uhn.fhir.model.dstu"); + rp.getLocalImports().putAll(datatypeLocalImports); + datatypeLocalImports.putAll(rp.getLocalImports()); - String vsOutputDir = "target/generated-sources/ca/uhn/fhir/model/dstu/valueset"; - vsp.writeMarkedValueSets(new File(vsOutputDir), "ca.uhn.fhir.model.dstu"); + dtp.writeAll(new File(dtOutputDir), null, "ca.uhn.fhir.model.dev"); + rp.writeAll(new File(rpOutputDir), new File(rpSOutputDir), "ca.uhn.fhir.model.dev"); + + String vsOutputDir = "target/generated-sources/tinder/ca/uhn/fhir/model/dev/valueset"; + vsp.writeMarkedValueSets(new File(vsOutputDir), "ca.uhn.fhir.model.dev"); } public static class ProfileFileDefinition { 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 03fe1905848..79b30d312c3 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 @@ -43,6 +43,11 @@ public class ValueSetGenerator { private Map myValueSets = new HashMap(); private int myValueSetCount; private int myConceptCount; + private String myVersion; + + public ValueSetGenerator(String theVersion) { + myVersion =theVersion; + } public String getClassForValueSetIdAndMarkAsNeeded(String theId) { ValueSetTm vs = myValueSets.get(theId); @@ -62,7 +67,7 @@ public class ValueSetGenerator { IParser newXmlParser = new FhirContext(ValueSet.class).newXmlParser(); ourLog.info("Parsing built-in ValueSets"); - String vs = IOUtils.toString(ValueSetGenerator.class.getResourceAsStream("/vs/all-valuesets-bundle.xml")); + String vs = IOUtils.toString(ValueSetGenerator.class.getResourceAsStream("/vs/" + myVersion + "/all-valuesets-bundle.xml")); Bundle bundle = newXmlParser.parseBundle(vs); for (BundleEntry next : bundle.getEntries()) { ValueSet nextVs = (ValueSet) next.getResource(); diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/BaseElement.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/BaseElement.java index 650ffb9b4f1..29cd2fe24a1 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/BaseElement.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/BaseElement.java @@ -48,10 +48,10 @@ public abstract class BaseElement { myChildren = new ArrayList(); } myChildren.add(theElem); - -// if (theElem.getDeclaringClassNameComplete()==null) { - theElem.setDeclaringClassNameComplete(getDeclaringClassNameCompleteForChildren()); -// } + + // if (theElem.getDeclaringClassNameComplete()==null) { + theElem.setDeclaringClassNameComplete(getDeclaringClassNameCompleteForChildren()); + // } } public String getBinding() { @@ -63,11 +63,11 @@ public abstract class BaseElement { } public String getCardMax() { - return defaultString(myCardMax,"1"); + return defaultString(myCardMax, "1"); } public String getCardMin() { - return defaultString(myCardMin,"0"); + return defaultString(myCardMin, "0"); } public Map getChildElementNameToSlicing() { @@ -90,7 +90,7 @@ public abstract class BaseElement { } private String toStringConstant(String theDefinition) { - if (theDefinition==null) { + if (theDefinition == null) { return ""; } StringBuffer b = new StringBuffer(); @@ -188,7 +188,7 @@ public abstract class BaseElement { public void setElementName(String theName) { myElementName = theName; } - + public void setElementNameAndDeriveParentElementName(String theName) { int lastDot = theName.lastIndexOf('.'); if (lastDot == -1) { @@ -220,16 +220,21 @@ public abstract class BaseElement { public void clearTypes() { getType().clear(); } - + public void setTypeFromString(String theType) { if (theType == null) { myType = null; return; } String typeString = theType; + typeString = typeString.replace("Reference (", "Reference("); + if (typeString.toLowerCase().startsWith("resource(")) { typeString = typeString.substring("Resource(".length(), typeString.length() - 1); myResourceRef = true; + } else if (typeString.toLowerCase().startsWith("reference(")) { + typeString = typeString.substring("Reference(".length(), typeString.length() - 1); + myResourceRef = true; } else if (typeString.startsWith("@")) { typeString = typeString.substring(1); typeString = ResourceBlock.convertFhirPathNameToClassName(typeString); @@ -238,22 +243,34 @@ public abstract class BaseElement { } if (StringUtils.isNotBlank(typeString)) { + + int idx = typeString.indexOf("Reference("); + if (idx != -1) { + int endIdx = typeString.indexOf(")"); + typeString = typeString.substring(0,idx) + typeString.substring(idx, endIdx).replace("|", ",") + typeString.substring(endIdx); + } + String[] types = typeString.replace("=", "").split("\\|"); for (String nextType : types) { nextType = nextType.trim(); - if (nextType.endsWith(")")){ - nextType = nextType.substring(0, nextType.length()-1); + if (nextType.endsWith(")")) { + nextType = nextType.substring(0, nextType.length() - 1); } if (nextType.toLowerCase().startsWith("resource(")) { nextType = nextType.substring("Resource(".length(), nextType.length()); nextType = nextType.substring(0, 1).toUpperCase() + nextType.substring(1); + } else if (nextType.toLowerCase().startsWith("reference(")) { + nextType = nextType.substring("Reference(".length(), nextType.length()); + nextType = nextType.substring(0, 1).toUpperCase() + nextType.substring(1); } else { nextType = nextType.substring(0, 1).toUpperCase() + nextType.substring(1); nextType = nextType + getTypeSuffix(); } - if (isNotBlank(nextType)) { - getType().add(nextType); + for (String next : nextType.split(",")) { + if (isNotBlank(next.trim())) { + getType().add(next.trim()); + } } } } @@ -276,7 +293,6 @@ public abstract class BaseElement { return false; // TODO: implemment } - public boolean isHasExtensionUrl() { return StringUtils.isNotBlank(myExtensionUrl); } diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/Child.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/Child.java index 723944e6143..7166d7c6878 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/Child.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/Child.java @@ -1,11 +1,14 @@ package ca.uhn.fhir.tinder.model; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.apache.commons.lang3.StringUtils; +import ca.uhn.fhir.model.api.BasePrimitive; import ca.uhn.fhir.model.api.IDatatype; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; @@ -38,11 +41,10 @@ public abstract class Child extends BaseElement { return getCardMax(); } } - @Override public String toString() { - return getClass().getSimpleName()+"[" + getName() + "]"; + return getClass().getSimpleName() + "[" + getName() + "]"; } /** @@ -62,9 +64,9 @@ public abstract class Child extends BaseElement { if ("Class".equals(elementName)) { elementName = "ClassElement"; } -// if ("Language".equals(elementName)) { -// elementName = "LanguageElement"; -// } + // if ("Language".equals(elementName)) { + // elementName = "LanguageElement"; + // } return elementName; } @@ -75,7 +77,7 @@ public abstract class Child extends BaseElement { } else if (this.getType().size() == 1 || this instanceof ResourceBlock) { if (isBoundCode()) { retVal = "Bound" + getSingleType() + "<" + getBindingClass() + ">"; - }else { + } else { retVal = getSingleType(); } } else { @@ -96,7 +98,7 @@ public abstract class Child extends BaseElement { public String getReferenceTypeForConstructor() { return getReferenceType().replaceAll("^java.util.List<", "java.util.ArrayList<"); } - + public List getReferenceTypesForMultiple() { ArrayList retVal = new ArrayList(); for (String next : getType()) { @@ -104,11 +106,11 @@ public abstract class Child extends BaseElement { next = "IResource"; } retVal.add(next); -// retVal.add(next + getTypeSuffix()); + // retVal.add(next + getTypeSuffix()); } return retVal; } - + public List getSimpleSetters() { if (isBoundCode()) { return Collections.emptyList(); @@ -120,11 +122,11 @@ public abstract class Child extends BaseElement { String retVal; String elemName = this.getType().get(0); elemName = elemName.substring(0, 1).toUpperCase() + elemName.substring(1); -// if (this instanceof ResourceBlock) { - retVal = (elemName); -// } else { -// retVal = (elemName + getTypeSuffix()); -// } + // if (this instanceof ResourceBlock) { + retVal = (elemName); + // } else { + // retVal = (elemName + getTypeSuffix()); + // } return retVal; } @@ -144,6 +146,36 @@ public abstract class Child extends BaseElement { return false; } + public boolean isPrimitive() { + + if (IDatatype.class.getSimpleName().equals(getReferenceType())) { + return false; + } + + try { + String name = "ca.uhn.fhir.model.primitive." + getSingleType(); + Class.forName(name); + return true; + } catch (ClassNotFoundException e) { + return false; + } + } + + public String getPrimitiveType() throws ClassNotFoundException { + String name = "ca.uhn.fhir.model.primitive." + getSingleType(); + Class clazz = Class.forName(name); + while (!clazz.getSuperclass().equals(BasePrimitive.class)) { + clazz = clazz.getSuperclass(); + if (clazz.equals(Object.class)) { + throw new Error("Parent of " + name + " is not BasePrimitive"); + } + } + + ParameterizedType type = (ParameterizedType) clazz.getGenericSuperclass(); + Class rawType = (Class) type.getActualTypeArguments()[0]; + return rawType.getSimpleName(); + } + public boolean isBoundCode() { String singleType = getSingleType(); if ("CodeDt".equals(singleType) || "CodeableConceptDt".equals(singleType)) { @@ -162,5 +194,4 @@ public abstract class Child extends BaseElement { return true; } - } diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/SearchParameter.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/SearchParameter.java index 11220dce24a..5989bb3694a 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/SearchParameter.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/SearchParameter.java @@ -77,7 +77,11 @@ public class SearchParameter { } public void setName(String theName) { - myName = theName; + if (theName != null && Character.isUpperCase(theName.charAt(0))) { + myName = theName.substring(theName.indexOf('.')+1); + }else { + myName = theName; + } } public void setPath(String thePath) { diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/parser/BaseStructureParser.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/parser/BaseStructureParser.java index e0ff32e29a0..9c1b7e11d3a 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/parser/BaseStructureParser.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/parser/BaseStructureParser.java @@ -32,6 +32,7 @@ import ca.uhn.fhir.model.api.ExtensionDt; import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.api.annotation.SimpleSetter; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; +import ca.uhn.fhir.model.dstu.resource.Binary; import ca.uhn.fhir.tinder.TinderStructuresMojo; import ca.uhn.fhir.tinder.ValueSetGenerator; import ca.uhn.fhir.tinder.model.BaseElement; @@ -47,40 +48,41 @@ import ca.uhn.fhir.tinder.model.SimpleSetter.Parameter; public abstract class BaseStructureParser { private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(BaseStructureParser.class); + private String myBaseDir; private ArrayList myExtensions; private TreeSet myImports = new TreeSet(); - private Map myLocallyDefinedClassNames = new HashMap(); - private List myResources = new ArrayList(); private boolean myImportsResolved; - private TreeMap myNameToResourceClass = new TreeMap(); + private Map myLocallyDefinedClassNames = new HashMap(); private TreeMap myNameToDatatypeClass = new TreeMap(); + private TreeMap myNameToResourceClass = new TreeMap(); + private String myPackageBase; + private List myResources = new ArrayList(); + private String myVersion; - public TreeMap getNameToDatatypeClass() { - return myNameToDatatypeClass; + public BaseStructureParser(String theVersion, String theBaseDir) { + myVersion = theVersion; + myBaseDir = theBaseDir; } - public void combineContentMaps(BaseStructureParser theStructureParser) { - myNameToResourceClass.putAll(theStructureParser.myNameToResourceClass); - myNameToDatatypeClass.putAll(theStructureParser.myNameToDatatypeClass); - theStructureParser.myNameToResourceClass.putAll(myNameToResourceClass); - theStructureParser.myNameToDatatypeClass.putAll(myNameToDatatypeClass); + public String getVersion() { + return myVersion; } - + + private void addImport(String bindingClass) { + myImports.add(bindingClass); + } + public void addResource(BaseRootType theResource) { myResources.add(theResource); } - public Map getLocalImports() { - return myLocallyDefinedClassNames; - } - private void bindValueSets(BaseElement theResource, ValueSetGenerator theVsp) { if (isNotBlank(theResource.getBinding())) { String bindingClass = theVsp.getClassForValueSetIdAndMarkAsNeeded(theResource.getBinding()); if (bindingClass != null) { ourLog.info("Adding binding ValueSet class: {}", bindingClass); theResource.setBindingClass(bindingClass); - myImports.add(bindingClass); + addImport(bindingClass); myLocallyDefinedClassNames.put(bindingClass, "valueset"); } else { ourLog.info("No binding found for: {}", theResource.getBinding()); @@ -98,7 +100,15 @@ public abstract class BaseStructureParser { } } - private ca.uhn.fhir.model.api.annotation.SimpleSetter.Parameter findAnnotation(Class theBase, Annotation[] theAnnotations, Class theClass) { + public void combineContentMaps(BaseStructureParser theStructureParser) { + myNameToResourceClass.putAll(theStructureParser.myNameToResourceClass); + myNameToDatatypeClass.putAll(theStructureParser.myNameToDatatypeClass); + theStructureParser.myNameToResourceClass.putAll(myNameToResourceClass); + theStructureParser.myNameToDatatypeClass.putAll(myNameToDatatypeClass); + } + + private ca.uhn.fhir.model.api.annotation.SimpleSetter.Parameter findAnnotation(Class theBase, Annotation[] theAnnotations, + Class theClass) { for (Annotation next : theAnnotations) { if (theClass.equals(next.annotationType())) { return (ca.uhn.fhir.model.api.annotation.SimpleSetter.Parameter) next; @@ -107,8 +117,51 @@ public abstract class BaseStructureParser { throw new IllegalArgumentException(theBase.getCanonicalName() + " has @" + SimpleSetter.class.getCanonicalName() + " constructor with no/invalid parameter annotation"); } + /** + * Example: Encounter has an internal block class named "Location", but it also has a reference to the Location resource type, so we need to use the fully qualified name for that resource + * reference + */ + private void fixResourceReferenceClassNames(BaseElement theNext, String thePackageBase) { + for (BaseElement next : theNext.getChildren()) { + fixResourceReferenceClassNames(next, thePackageBase); + } + + if (theNext.isResourceRef()) { + for (int i = 0; i < theNext.getType().size(); i++) { + String nextTypeName = theNext.getType().get(i); + if ("Any".equals(nextTypeName)) { + continue; + } + // if ("Location".equals(nextTypeName)) { + // ourLog.info("***** Checking for Location"); + // ourLog.info("***** Imports are: {}", new + // TreeSet(myImports)); + // } + boolean found = false; + for (String nextImport : myImports) { + if (nextImport.endsWith(".resource." + nextTypeName)) { + // ourLog.info("***** Found match " + nextImport); + theNext.getType().set(i, nextImport); + found = true; + } + } + if (!found) { + theNext.getType().set(i, thePackageBase + ".resource." + nextTypeName); + } + } + } + } + protected abstract String getFilenameSuffix(); + public Map getLocalImports() { + return myLocallyDefinedClassNames; + } + + public TreeMap getNameToDatatypeClass() { + return myNameToDatatypeClass; + } + public List getResources() { return myResources; } @@ -119,6 +172,100 @@ public abstract class BaseStructureParser { return true; } + public void markResourcesForImports() { + for (BaseRootType next : myResources) { + if (next instanceof Resource) { + myLocallyDefinedClassNames.put(next.getName(), "resource"); + } else if (next instanceof Composite) { + myLocallyDefinedClassNames.put(next.getName() + "Dt", "composite"); + } else { + throw new IllegalStateException(next.getClass() + ""); + } + } + } + + private void scanForCorrections(BaseRootType theNext) { + if (theNext.getElementName().equals("ResourceReference")) { + for (BaseElement next : theNext.getChildren()) { + if (next.getElementName().equals("reference")) { + next.clearTypes(); + next.setTypeFromString("id"); + scanForSimpleSetters((Child) next); + } + } + } + } + + private String scanForImportNamesAndReturnFqn(String theNextType) throws MojoFailureException { + if ("Any".equals(theNextType)) { + return (IResource.class.getCanonicalName()); + } + if ("ExtensionDt".equals(theNextType)) { + return (ExtensionDt.class.getCanonicalName()); + } + if ("ResourceReferenceDt".equals(theNextType)) { + return ResourceReferenceDt.class.getCanonicalName(); + } + if ("Binary".equals(theNextType)) { + return Binary.class.getCanonicalName(); + } + // QuantityCompararatorEnum + // QuantityComparatorEnum + + if (myLocallyDefinedClassNames.containsKey(theNextType)) { + return (theNextType); + } else { + try { + String type = myPackageBase + ".composite." + theNextType; + Class.forName(type); + return (type); + } catch (ClassNotFoundException e) { + try { + String type = "ca.uhn.fhir.model."+myVersion+ ".composite." + theNextType; + Class.forName(type); + return (type); + } catch (ClassNotFoundException e5) { + try { + String type = "ca.uhn.fhir.model."+myVersion+".resource." + theNextType; + Class.forName(type); + return (type); + } catch (ClassNotFoundException e1) { + try { + String type = "ca.uhn.fhir.model.primitive." + theNextType; + Class.forName(type); + return (type); + } catch (ClassNotFoundException e2) { + try { + String type = myPackageBase + ".valueset." + theNextType; + Class.forName(type); + return (type); + } catch (ClassNotFoundException e3) { + try { + String type = "ca.uhn.fhir.model.api." + theNextType; + Class.forName(type); + return (type); + } catch (ClassNotFoundException e4) { + try { + String type = "ca.uhn.fhir.model."+myVersion+".valueset." + theNextType; + Class.forName(type); + return (type); + } catch (ClassNotFoundException e6) { + String fileName = myBaseDir + "/src/main/java/" + myPackageBase.replace('.', '/') + "/composite/" + theNextType + ".java"; + File file = new File(fileName); + if (file.exists()) { + return myPackageBase + ".composite." + theNextType; + } + throw new MojoFailureException("Unknown type: " + theNextType + " - Have locally defined names: " + new TreeSet(myLocallyDefinedClassNames.keySet())); + } + } + } + } + } + } + } + } + } + private void scanForImportsNames(BaseElement theNext) throws MojoFailureException { for (BaseElement next : theNext.getChildren()) { ourLog.debug("Element Name: {}", next.getName()); @@ -138,52 +285,7 @@ public abstract class BaseStructureParser { } private void scanForImportsNames(String theNextType) throws MojoFailureException { - myImports.add(scanForImportNamesAndReturnFqn(theNextType)); - } - - private String scanForImportNamesAndReturnFqn(String theNextType) throws MojoFailureException { - if ("Any".equals(theNextType)) { - return (IResource.class.getCanonicalName()); - } - if ("ExtensionDt".equals(theNextType)) { - return (ExtensionDt.class.getCanonicalName()); - } - - if (myLocallyDefinedClassNames.containsKey(theNextType)) { - return (theNextType); - } else { - try { - String type = "ca.uhn.fhir.model.dstu.composite." + theNextType; - Class.forName(type); - return (type); - } catch (ClassNotFoundException e) { - try { - String type = "ca.uhn.fhir.model.dstu.resource." + theNextType; - Class.forName(type); - return (type); - } catch (ClassNotFoundException e1) { - try { - String type = "ca.uhn.fhir.model.primitive." + theNextType; - Class.forName(type); - return (type); - } catch (ClassNotFoundException e2) { - try { - String type = "ca.uhn.fhir.model.dstu.valueset." + theNextType; - Class.forName(type); - return (type); - } catch (ClassNotFoundException e3) { - try { - String type = "ca.uhn.fhir.model.api." + theNextType; - Class.forName(type); - return (type); - } catch (ClassNotFoundException e4) { - throw new MojoFailureException("Unknown type: " + theNextType + " - Have locally defined names: " + new TreeSet(myLocallyDefinedClassNames.keySet())); - } - } - } - } - } - } + addImport(scanForImportNamesAndReturnFqn(theNextType)); } protected void scanForSimpleSetters(Child theElem) { @@ -192,9 +294,13 @@ public abstract class BaseStructureParser { try { childDt = Class.forName("ca.uhn.fhir.model.primitive." + theElem.getReferenceTypesForMultiple().get(0)); } catch (ClassNotFoundException e) { - try { - childDt = Class.forName("ca.uhn.fhir.model.dstu.composite." + theElem.getReferenceTypesForMultiple().get(0)); - } catch (ClassNotFoundException e2) { + if (myVersion.equals("dstu")) { + try { + childDt = Class.forName("ca.uhn.fhir.model.dstu.composite." + theElem.getReferenceTypesForMultiple().get(0)); + } catch (ClassNotFoundException e2) { + return; + } + } else { return; } } @@ -221,7 +327,7 @@ public abstract class BaseStructureParser { p.setDatatype(paramTypes[i].getCanonicalName()); } else { if (paramTypes[i].getCanonicalName().startsWith("ca.uhn.fhir")) { - myImports.add(paramTypes[i].getSimpleName()); + addImport(paramTypes[i].getSimpleName()); } p.setDatatype(paramTypes[i].getSimpleName()); } @@ -262,6 +368,13 @@ public abstract class BaseStructureParser { myExtensions = theExts; } + private String translateClassName(String theName) { + if ("List".equals(theName)) { + return "ListResource"; + } + return theName; + } + private void write(BaseRootType theResource, File theFile, String thePackageBase) throws IOException, MojoFailureException { FileWriter w = new FileWriter(theFile, false); @@ -287,6 +400,7 @@ public abstract class BaseStructureParser { ctx.put("hash", "#"); ctx.put("imports", imports); ctx.put("profile", theResource.getProfile()); + ctx.put("version", myVersion); ctx.put("id", StringUtils.defaultString(theResource.getId())); if (theResource.getDeclaringClassNameComplete() != null) { ctx.put("className", theResource.getDeclaringClassNameComplete()); @@ -317,19 +431,9 @@ public abstract class BaseStructureParser { w.close(); } - public void markResourcesForImports() { - for (BaseRootType next : myResources) { - if (next instanceof Resource) { - myLocallyDefinedClassNames.put(next.getName(), "resource"); - } else if (next instanceof Composite) { - myLocallyDefinedClassNames.put(next.getName() + "Dt", "composite"); - } else { - throw new IllegalStateException(next.getClass() + ""); - } - } - } - public void writeAll(File theOutputDirectory, File theResourceOutputDirectory, String thePackageBase) throws MojoFailureException { + myPackageBase = thePackageBase; + if (!theOutputDirectory.exists()) { theOutputDirectory.mkdirs(); } @@ -389,6 +493,7 @@ public abstract class BaseStructureParser { VelocityContext ctx = new VelocityContext(); ctx.put("nameToResourceClass", myNameToResourceClass); ctx.put("nameToDatatypeClass", myNameToDatatypeClass); + ctx.put("version", myVersion); VelocityEngine v = new VelocityEngine(); v.setProperty("resource.loader", "cp"); @@ -406,60 +511,6 @@ public abstract class BaseStructureParser { } } - private void scanForCorrections(BaseRootType theNext) { - if (theNext.getElementName().equals("ResourceReference")) { - for (BaseElement next : theNext.getChildren()) { - if (next.getElementName().equals("reference")) { - next.clearTypes(); - next.setTypeFromString("id"); - scanForSimpleSetters((Child) next); - } - } - } - } - - private String translateClassName(String theName) { - if ("List".equals(theName)) { - return "ListResource"; - } - return theName; - } - - /** - * Example: Encounter has an internal block class named "Location", but it also has a reference to the Location - * resource type, so we need to use the fully qualified name for that resource reference - */ - private void fixResourceReferenceClassNames(BaseElement theNext, String thePackageBase) { - for (BaseElement next : theNext.getChildren()) { - fixResourceReferenceClassNames(next, thePackageBase); - } - - if (theNext.isResourceRef()) { - for (int i = 0; i < theNext.getType().size(); i++) { - String nextTypeName = theNext.getType().get(i); - if ("Any".equals(nextTypeName)) { - continue; - } - // if ("Location".equals(nextTypeName)) { - // ourLog.info("***** Checking for Location"); - // ourLog.info("***** Imports are: {}", new - // TreeSet(myImports)); - // } - boolean found = false; - for (String nextImport : myImports) { - if (nextImport.endsWith(".resource." + nextTypeName)) { - // ourLog.info("***** Found match " + nextImport); - theNext.getType().set(i, nextImport); - found = true; - } - } - if (!found) { - theNext.getType().set(i, thePackageBase + ".resource." + nextTypeName); - } - } - } - } - static String cellValue(Node theRowXml, int theCellIndex) { NodeList cells = ((Element) theRowXml).getElementsByTagName("Cell"); 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..ec72e28df8b 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; @@ -31,6 +31,11 @@ import ca.uhn.fhir.tinder.model.SimpleChild; import ca.uhn.fhir.tinder.util.XMLUtils; public abstract class BaseStructureSpreadsheetParser extends BaseStructureParser { + + public BaseStructureSpreadsheetParser(String theVersion, String theBaseDir) { + super(theVersion, theBaseDir); + } + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(BaseStructureSpreadsheetParser.class); private int myColBinding; private int myColCard; diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/parser/DatatypeGeneratorUsingSpreadsheet.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/parser/DatatypeGeneratorUsingSpreadsheet.java index 11f9f272c39..f06e4f87e91 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/parser/DatatypeGeneratorUsingSpreadsheet.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/parser/DatatypeGeneratorUsingSpreadsheet.java @@ -20,9 +20,16 @@ import com.google.common.reflect.ClassPath.ClassInfo; public class DatatypeGeneratorUsingSpreadsheet extends BaseStructureSpreadsheetParser { + private String myVersion; + + public DatatypeGeneratorUsingSpreadsheet(String theVersion, String theBaseDir) { + super(theVersion, theBaseDir); + myVersion = theVersion; + } + @Override protected String getTemplate() { - return "/vm/dt_composite.vm"; + return "dstu".equals(myVersion) ? "/vm/dt_composite_dstu.vm" : "/vm/dt_composite.vm"; } @Override @@ -71,22 +78,30 @@ public class DatatypeGeneratorUsingSpreadsheet extends BaseStructureSpreadsheetP protected List getInputStreamNames() { ArrayList retVal = new ArrayList(); - retVal.add(("/dt/address.xml")); - retVal.add(("/dt/coding.xml")); - retVal.add(("/dt/humanname.xml")); - retVal.add(("/dt/period.xml")); - retVal.add(("/dt/ratio.xml")); - retVal.add(("/dt/schedule.xml")); - retVal.add(("/dt/attachment.xml")); - retVal.add(("/dt/contact.xml")); - retVal.add(("/dt/identifier.xml")); - retVal.add(("/dt/quantity.xml")); - retVal.add(("/dt/resourcereference.xml")); - retVal.add(("/dt/codeableconcept.xml")); -// retVal.add(("/dt/extension.xml")); -// retVal.add(("/dt/narrative.xml")); - retVal.add(("/dt/range.xml")); - retVal.add(("/dt/sampleddata.xml")); + retVal.add(("/dt/" + myVersion + "/address.xml")); + retVal.add(("/dt/" + myVersion + "/attachment.xml")); + retVal.add(("/dt/" + myVersion + "/codeableconcept.xml")); + retVal.add(("/dt/" + myVersion + "/coding.xml")); + retVal.add(("/dt/" + myVersion + "/humanname.xml")); + retVal.add(("/dt/" + myVersion + "/identifier.xml")); + retVal.add(("/dt/" + myVersion + "/period.xml")); + retVal.add(("/dt/" + myVersion + "/ratio.xml")); + retVal.add(("/dt/" + myVersion + "/quantity.xml")); + retVal.add(("/dt/" + myVersion + "/range.xml")); + retVal.add(("/dt/" + myVersion + "/sampleddata.xml")); + + if ("dstu".equals(myVersion)) { + retVal.add(("/dt/" + myVersion + "/contact.xml")); +// retVal.add(("/dt/" + myVersion + "/resourcereference.xml")); + retVal.add(("/dt/" + myVersion + "/schedule.xml")); + } + + if (!myVersion.equals("dstu")) { + retVal.add(("/dt/" + myVersion + "/reference.xml")); + retVal.add(("/dt/" + myVersion + "/attachment.xml")); + retVal.add(("/dt/" + myVersion + "/contactpoint.xml")); + retVal.add(("/dt/" + myVersion + "/timing.xml")); + } return retVal; } diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/parser/ProfileParser.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/parser/ProfileParser.java index b990d7b6010..82895011177 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/parser/ProfileParser.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/parser/ProfileParser.java @@ -38,6 +38,10 @@ import ca.uhn.fhir.tinder.model.Slicing; public class ProfileParser extends BaseStructureParser { + public ProfileParser(String theVersion, String theBaseDir) { + super(theVersion, theBaseDir); + } + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ProfileParser.class); private ExtensionDefn findExtension(Profile theProfile, String theCode) { @@ -56,7 +60,7 @@ public class ProfileParser extends BaseStructureParser { @Override protected String getTemplate() { - return "/vm/resource.vm"; + return "dstu".equals(getVersion()) ? "/vm/resource_dstu.vm" : "/vm/resource.vm"; } public void parseSingleProfile(File theProfile, String theHttpUrl) throws MojoFailureException { @@ -304,7 +308,7 @@ public class ProfileParser extends BaseStructureParser { public static void main(String[] args) throws Exception { IParser parser = new FhirContext(Profile.class).newXmlParser(); - ProfileParser pp = new ProfileParser(); + ProfileParser pp = new ProfileParser("dev","."); String str = IOUtils.toString(new FileReader("../hapi-tinder-test/src/test/resources/profile/organization.xml")); Profile prof = parser.parseResource(Profile.class, str); diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/parser/ResourceGeneratorUsingSpreadsheet.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/parser/ResourceGeneratorUsingSpreadsheet.java index f97f624b83b..38371f2bc67 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/parser/ResourceGeneratorUsingSpreadsheet.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/parser/ResourceGeneratorUsingSpreadsheet.java @@ -1,6 +1,5 @@ package ca.uhn.fhir.tinder.parser; -import java.io.File; import java.io.InputStream; import java.util.ArrayList; import java.util.Collection; @@ -11,14 +10,18 @@ import org.apache.maven.plugin.MojoFailureException; import ca.uhn.fhir.tinder.model.BaseRootType; import ca.uhn.fhir.tinder.model.Resource; - - public class ResourceGeneratorUsingSpreadsheet extends BaseStructureSpreadsheetParser { private String myFilenameSuffix = ""; private List myInputStreamNames; private ArrayList myInputStreams; - private String myTemplate="/vm/resource.vm"; - + private String myTemplate = null; + private String myVersion; + + public ResourceGeneratorUsingSpreadsheet(String theVersion, String theBaseDir) { + super(theVersion, theBaseDir); + myVersion = theVersion; + } + public List getInputStreamNames() { return myInputStreamNames; } @@ -26,12 +29,13 @@ public class ResourceGeneratorUsingSpreadsheet extends BaseStructureSpreadsheetP public void setBaseResourceNames(List theBaseResourceNames) throws MojoFailureException { myInputStreamNames = theBaseResourceNames; myInputStreams = new ArrayList(); - + for (String next : theBaseResourceNames) { - InputStream nextRes = getClass().getResourceAsStream("/res/" + next + "-spreadsheet.xml"); + String resName = "/res/" + myVersion + "/" + next + "-spreadsheet.xml"; + InputStream nextRes = getClass().getResourceAsStream(resName); myInputStreams.add(nextRes); if (nextRes == null) { - throw new MojoFailureException("Unknown base resource name: " + next); + throw new MojoFailureException("Unknown base resource name: " + resName); } } } @@ -49,7 +53,6 @@ public class ResourceGeneratorUsingSpreadsheet extends BaseStructureSpreadsheetP return new Resource(); } - @Override protected String getFilenameSuffix() { return myFilenameSuffix; @@ -62,7 +65,13 @@ public class ResourceGeneratorUsingSpreadsheet extends BaseStructureSpreadsheetP @Override protected String getTemplate() { - return myTemplate; + if (myTemplate != null) { + return myTemplate; + } else if ("dstu".equals(myVersion)) { + return "/vm/resource_dstu.vm"; + } else { + return "/vm/resource.vm"; + } } @Override @@ -70,110 +79,4 @@ public class ResourceGeneratorUsingSpreadsheet extends BaseStructureSpreadsheetP return theFileName.endsWith("spreadsheet.xml"); } - public static void main(String[] args) throws Exception { - ResourceGeneratorUsingSpreadsheet p = new ResourceGeneratorUsingSpreadsheet(); - ArrayList names = new ArrayList(); - names.add("conceptmap"); - names.add("list"); - names.add("person"); - p.setBaseResourceNames(names); - p.parse(); - p.markResourcesForImports(); - p.writeAll(new File("target/gen/ca/uhn/fhir/model/dstu/resource"), null,"ca.uhn.fhir.model.dstu"); -// -// // TODO: this needs to be properly populated -// p.getAllDatatypes().add("String"); -// p.getAllDatatypes().add("Date"); -// p.getAllDatatypes().add("DateTime"); -// -//// p.setDirectory("src/test/resources/res"); -//// p.setResourceName("patient"); -//// p.setOutputFile(basePath + "/ca/uhn/fhir/model/dstu/resource/ResourceWithExtensionsA.java"); -//// ArrayList exts = new ArrayList(); -//// Extension ext1 = new Extension("foo1", "http://foo/1", "string"); -//// exts.add(ext1); -//// Extension ext2 = new Extension("bar1", "http://bar/1", new Extension("bar11", "http://bar/1/1", "date"), new Extension("bar12", "http://bar/1/2", "date")); -//// exts.add(ext2); -//// p.setExtensions(exts); -//// p.parse(); -// -//// String basePath="../hapi-fhir-base/src/main/java"; -// String basePath="target/generated/valuesets"; -// -// p.setResourceName("medication"); -// p.setOutputFile(basePath + "/ca/uhn/fhir/model/dstu/resource/Medication.java"); -// p.parse(); -// -// p.setDirectory("src/test/resources/res"); -// p.setResourceName("substance"); -// p.setOutputFile(basePath + "/ca/uhn/fhir/model/dstu/resource/Substance.java"); -// p.parse(); -// -// -// p.setDirectory("src/test/resources/res"); -// p.setResourceName("valueset"); -// p.setOutputFile(basePath + "/ca/uhn/fhir/model/dstu/resource/ValueSetTm.java"); -// p.parse(); -// -// p.setDirectory("src/test/resources/res"); -// p.setResourceName("observation"); -// p.setOutputFile(basePath + "/ca/uhn/fhir/model/dstu/resource/Observation.java"); -// p.parse(); -// -// p.setResourceName("profile"); -// p.setOutputFile(basePath + "/ca/uhn/fhir/model/dstu/resource/Profile.java"); -// p.parse(); -// -// p.setResourceName("device"); -// p.setOutputFile(basePath + "/ca/uhn/fhir/model/dstu/resource/Device.java"); -// p.parse(); -// -// p.setResourceName("group"); -// p.setOutputFile(basePath + "/ca/uhn/fhir/model/dstu/resource/Group.java"); -// p.parse(); -// -// p.setResourceName("location"); -// p.setOutputFile(basePath + "/ca/uhn/fhir/model/dstu/resource/Location.java"); -// p.parse(); -// -// p.setResourceName("organization"); -// p.setOutputFile(basePath + "/ca/uhn/fhir/model/dstu/resource/Organization.java"); -// p.parse(); -// -// p.setResourceName("patient"); -// p.setOutputFile(basePath + "/ca/uhn/fhir/model/dstu/resource/Patient.java"); -// p.parse(); -// -// p.setResourceName("specimen"); -// p.setOutputFile(basePath + "/ca/uhn/fhir/model/dstu/resource/Specimen.java"); -// p.parse(); -// -// p.setResourceName("practitioner"); -// p.setOutputFile(basePath + "/ca/uhn/fhir/model/dstu/resource/Practitioner.java"); -// p.parse(); -// -// DatatypeSpreadsheetParser d = new DatatypeSpreadsheetParser(); -// d.setDirectory("src/test/resources/dt"); -// d.setDatatypeName("humanname"); -// d.setOutputFile(basePath + "/ca/uhn/fhir/model/dstu/composite/HumanNameDt.java"); -// d.parse(); -// -// d.setDatatypeName("contact"); -// d.setOutputFile(basePath + "/ca/uhn/fhir/model/dstu/composite/ContactDt.java"); -// d.parse(); -// -// d.setDatatypeName("address"); -// d.setOutputFile(basePath + "/ca/uhn/fhir/model/dstu/composite/AddressDt.java"); -// d.parse(); -// -// d.setDatatypeName("narrative"); -// d.setOutputFile(basePath + "/ca/uhn/fhir/model/dstu/composite/NarrativeDt.java"); -// d.parse(); -// -// d.setDatatypeName("quantity"); -// d.setOutputFile(basePath + "/ca/uhn/fhir/model/dstu/composite/QuantityDt.java"); -// d.parse(); - - } - } \ No newline at end of file diff --git a/hapi-tinder-plugin/src/main/resources/dt/dev/activitydefinition.xml b/hapi-tinder-plugin/src/main/resources/dt/dev/activitydefinition.xml new file mode 100644 index 00000000000..b81f6be91f2 --- /dev/null +++ b/hapi-tinder-plugin/src/main/resources/dt/dev/activitydefinition.xml @@ -0,0 +1,677 @@ + + + + + Grahame + Lloyd McKenzie + 2012-03-19T11:22:15Z + 2013-04-22T02:38:01Z + 14.00 + + + + + + 8445 + 23250 + 3360 + 3510 + False + False + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Element + Card. + Inv. + Is Modifier + UML + Type + Binding + Short Name + Definition + Aliases + Requirements + Comments + RIM Mapping + v2 Mapping + To Do + Committee Notes + + + ActivityDefinition + + + + + SharedDefinition + Information about a type of activity that can be performed + Used as part of care plans, protocols and other resources that describe + Act + + + ActivityDefinition.category + 0..1 + + + + code + ActivityDefinitionCategory + diet | drug | encounter | observation + + High-level categorization of the type of activity. + + May determine what types of extensions are permitted + + .classCode + + + + + + + Should this be an HL7-defined code? Do we need more (e.g. accomodation) + + + ActivityDefinition.code + 0..1 + + + + CodeableConcept + ActivityDefinitionType + Detail type of activity + Detailed description of the type of activity. E.g. What lab test, what procedure, what kind of encounter. + + Allows matching performed to planned as well as validation against protocols + Tends to be less relevant for activities involving particular products. + .code + + + + + + + + + + ActivityDefinition.timing[x] + 0..1 + + + + CodeableConcept | Schedule + ActivityTiming + When activity is to occur + The period, timing or frequency upon which the described activity is to occur. + + Allows prompting for activities and detection of missed planned activities. + + .effectiveTime + + Add constraint prohibiting event (once it won't raise an error on the name timingSchedule) + + + + + + + + ActivityDefinition.location + 0..1 + + + + Reference(Location) + + Where it should happen + Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc. + facility + Helps in planning of activity + May reference a specific clinical location or may just identify a type of location. + + + + + + + + + + + ActivityDefinition.performer + 0..* + + + + Reference(Practitioner|Organization|RelatedPerson|Patient) + + Who's responsible? + Identifies who's expected to be involved in the activity. + + Helps in planning of activity + + + + + + + + + + + + ActivityDefinition.product + 0..1 + + + + Reference(Medication|Substance) + + What's administered/supplied + Identifies the food, drug or other product being consumed or supplied in the activity. + + + + + + + + + + + + + + ActivityDefinition.quantity + 0..1 + + + + Quantity + + How much is administered/consumed/supplied + Identifies the quantity expected to be consumed at once (per dose, per meal, etc.) + dose + + + + + + + + + + + + + ActivityDefinition.details + 0..1 + + + + string + + Extra info on activity occurrence + This provides a textual description of constraints on the activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+